Antarctica - ASV analysis

Initialize

Libraries

   if(any(grepl("package:dvutils", search()))) detach("package:dvutils", unload=TRUE)
   library(dvutils)
   library(stringr)
   library(ggplot2)
   library(dplyr)
   library(tidyr)
   library(tibble)
   library(readr)
   library(maps)
   library(glue)
   library(readxl)
   library(rlang)
   
   library(phyloseq)

   library(knitr)
   library(rmdformats)

   library(patchwork)

   # library(pr2database)
   # data("pr2")

Markdown

Read the colors

class_colors <- read_excel("colors.xlsx", sheet = "classes")

class_colors <- structure(class_colors$color_name, .Names = class_colors$class)

genus_colors <- read_excel("colors.xlsx", sheet = "genus")

genus_colors <- structure(genus_colors$color_name, .Names = genus_colors$genus)

Get the list of samples for GenBank submission - 2020-07-09 - DO NOT RUN

genbank <- metapr2_export_asv(dataset_id_selected = c(16, 17, 18), export_phyloseq = FALSE, export_long_xls = FALSE, export_wide_xls = FALSE, export_fasta = FALSE, 
    export_sample_xls = TRUE, boot_min = 90, boot_level = supergroup_boot, directory = "../genbank/")

Get the Antarctica ASVs

set id description
16 Antar_2015_18S_V4
17 Antar_2015_16S_plastid
18 Antar_2015_18S_V4_sorted
  • Only use asv for which supergroup_boot >= 90
  • Only keep photosynthetic groups abd exclude dinoflagellates

Initialize constants

# rm(list = ls())
sample_type <- c("18S filter", "16S plastid", "18S sort")
taxon_selected <- c("Chlorophyta", "Cryptophyta", "Rhodophyta", "Haptophyta", "Ochrophyta")

ps <- list()
long <- list()

Read the data from the database (only done once) - DO NOT RUN !

temp <- list()

# Export as specific data set as a phyloseq file

for (i in 1:3) {
    
    temp <- metapr2_export_asv(dataset_id_selected = i + 15, taxo_level = division, taxo_name = taxon_selected, export_phyloseq = TRUE, export_long_xls = FALSE, 
        export_wide_xls = TRUE, export_fasta = TRUE, export_sample_xls = TRUE, boot_min = 90, boot_level = supergroup_boot, directory = "../dada2/")
    
    
}


rm(temp)

Read the Phyloseq files from the disk

  • Only keep station 6
  • Do not consider TFF samples
for (i in 1:3) {
    
    ps[[sample_type[i]]] <- readRDS(str_c("../dada2/phyloseq_metapr2_asv_set_", i + 15, "_photo.rda"))
    
    
    # Filter out station 14
    ps[[sample_type[i]]] <- subset_samples(ps[[sample_type[i]]], station_id == "6")
    
    # Filter out TFF concentrated samples
    if (i == 3) {
        ps[[sample_type[i]]] <- subset_samples(ps[[sample_type[i]]], is.na(sample_concentration))
    }
    
    
    ps[[sample_type[i]]] <- ps[[sample_type[i]]] %>% # Filter ASVs that are absent
    filter_taxa(function(x) sum(x) > 0, TRUE) %>% # Filter Paraphysomonas
    subset_taxa(family != "Chrysophyceae_Clade-F")
    
    # Label samples with date
    sample_data(ps[[sample_type[i]]])$sample_label <- as.character(sample_data(ps[[sample_type[i]]])$date)
    
    # Add TFF to sample name sample_data(ps[[one_sample_type]])$sample_label <- str_c(sample_data(ps[[one_sample_type]])$metadata_code,
    # str_replace_na(sample_data(ps[[one_sample_type]])$sample_concentration, ''), sep = '.' )
    
    print(glue("Phyloseq - {sample_type[i]}"))
    print(ps[[sample_type[i]]])
    print(glue("Mean number of reads: {mean(sample_sums(ps[[ sample_type[i] ]]))}"))
    cat("============================\n")
    mean(sample_sums(ps[[sample_type[i]]]))
    
}
Phyloseq - 18S filter
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 681 taxa and 120 samples ]
sample_data() Sample Data:       [ 120 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 681 taxa by 8 taxonomic ranks ]
Mean number of reads: 27029.1083333333
============================
Phyloseq - 16S plastid
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 417 taxa and 100 samples ]
sample_data() Sample Data:       [ 100 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 417 taxa by 8 taxonomic ranks ]
Mean number of reads: 35058.32
============================
Phyloseq - 18S sort
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 195 taxa and 40 samples ]
sample_data() Sample Data:       [ 40 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 195 taxa by 8 taxonomic ranks ]
Mean number of reads: 31960.325
============================
sample_variables(ps[["18S filter"]])
 [1] "sample_id"                   "file_name"                   "NCBI_run"                    "sample_name"                
 [5] "sample_code"                 "metadata_code"               "DNA_RNA"                     "fraction_name"              
 [9] "fraction_name_original"      "fraction_min"                "fraction_max"                "reads_total"                
[13] "metadata_id"                 "project"                     "station_id"                  "station_id_num"             
[17] "year"                        "date"                        "time"                        "season"                     
[21] "depth_level"                 "depth"                       "substrate"                   "latitude"                   
[25] "longitude"                   "site_name"                   "country"                     "oceanic_region"             
[29] "temperature"                 "salinity"                    "pH"                          "O2"                         
[33] "fluorescence"                "Chla"                        "Chla_0.2_3.um"               "NO2"                        
[37] "NO3"                         "PO4"                         "Si"                          "bact_ml"                    
[41] "peuk_ml"                     "neuk_ml"                     "crypto_ml"                   "dataset_code"               
[45] "dataset_name"                "processing_pipeline_metapr2" "processing_date"             "sequencing_technology"      
[49] "sequencing_type"             "sequencing_company"          "region"                      "ecosystem"                  
[53] "lat_min"                     "lat_max"                     "long_min"                    "long_max"                   
[57] "data_available"              "bioproject_accession"        "bioproject_link"             "sample_label"               
mean(sample_sums(ps[["18S filter"]]))
[1] 27029.11

Get the different fraction separately

fraction_filter <- c(0.2, 3, 20)
fraction_sort <- c("pico", "nano")

sample_type_filtered <- c(str_c(sample_type[1], fraction_filter, "um", sep = " "), str_c(sample_type[2], fraction_filter, "um", sep = " "), str_c(sample_type[3], 
    fraction_sort, sep = " "))

# Export as specific data set as a phyloseq file

for (one_sample_type in sample_type[1:2]) {
    for (one_fraction in fraction_filter) {
        one_sample_type_filtered <- c(str_c(one_sample_type, one_fraction, "um", sep = " "))
        ps[[one_sample_type_filtered]] <- ps[[one_sample_type]] %>% subset_samples(fraction_min == one_fraction) %>% filter_taxa(function(x) sum(x) > 
            0, TRUE)
        
        print(glue("Phyloseq - {one_sample_type_filtered}"))
        print(ps[[one_sample_type_filtered]])
        cat("============================\n")
    }
    
}
Phyloseq - 18S filter 0.2 um
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 317 taxa and 42 samples ]
sample_data() Sample Data:       [ 42 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 317 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S filter 3 um
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 366 taxa and 43 samples ]
sample_data() Sample Data:       [ 43 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 366 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S filter 20 um
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 299 taxa and 35 samples ]
sample_data() Sample Data:       [ 35 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 299 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 16S plastid 0.2 um
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 181 taxa and 28 samples ]
sample_data() Sample Data:       [ 28 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 181 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 16S plastid 3 um
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 219 taxa and 41 samples ]
sample_data() Sample Data:       [ 41 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 219 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 16S plastid 20 um
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 212 taxa and 31 samples ]
sample_data() Sample Data:       [ 31 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 212 taxa by 8 taxonomic ranks ]
============================
# Sorted samples

for (one_sample_type in sample_type[3]) {
    for (one_fraction in fraction_sort) {
        one_sample_type_filtered <- c(str_c(one_sample_type, one_fraction, sep = " "))
        ps[[one_sample_type_filtered]] <- ps[[one_sample_type]] %>% subset_samples(fraction_name == one_fraction) %>% filter_taxa(function(x) sum(x) > 
            0, TRUE)
        
        print(glue("Phyloseq - {one_sample_type_filtered}"))
        print(ps[[one_sample_type_filtered]])
        cat("============================\n")
    }
    
}
Phyloseq - 18S sort pico
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 123 taxa and 20 samples ]
sample_data() Sample Data:       [ 20 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 123 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S sort nano
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 107 taxa and 20 samples ]
sample_data() Sample Data:       [ 20 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 107 taxa by 8 taxonomic ranks ]
============================
sample_type_all <- c(sample_type, sample_type_filtered)

Surface samples

  • Only surface considered (5 m)
  • Very important, must remove taxa that are not present in the filtered samples
sample_type_surface <- str_c(sample_type_all, " surface")

for (one_sample_type in sample_type_all) {
    
    one_sample_type_surface = str_c(one_sample_type, " surface")
    
    ps[[one_sample_type_surface]] <- ps[[one_sample_type]] %>% subset_samples(depth_level == "surface") %>% filter_taxa(function(x) sum(x) > 0, 
        TRUE)
    
    # Rename the samples
    
    if (!str_detect(one_sample_type_surface, "sort")) {
        sample_names(ps[[one_sample_type_surface]]) <- str_c(as.character(sample_data(ps[[one_sample_type_surface]])$date), as.character(sample_data(ps[[one_sample_type_surface]])$depth), 
            "m", as.character(sample_data(ps[[one_sample_type_surface]])$fraction_min), sep = "_")
    } else {
        sample_names(ps[[one_sample_type_surface]]) <- str_c(as.character(sample_data(ps[[one_sample_type_surface]])$date), as.character(sample_data(ps[[one_sample_type_surface]])$depth), 
            "m", as.character(sample_data(ps[[one_sample_type_surface]])$fraction_name), sep = "_")
    }
    
    
    print(glue("Phyloseq - {one_sample_type_surface}"))
    print(ps[[one_sample_type_surface]])
    cat("============================\n")
    
}
Phyloseq - 18S filter surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 383 taxa and 50 samples ]
sample_data() Sample Data:       [ 50 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 383 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 16S plastid surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 236 taxa and 40 samples ]
sample_data() Sample Data:       [ 40 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 236 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S sort surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 114 taxa and 16 samples ]
sample_data() Sample Data:       [ 16 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 114 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S filter 0.2 um surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 187 taxa and 17 samples ]
sample_data() Sample Data:       [ 17 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 187 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S filter 3 um surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 225 taxa and 18 samples ]
sample_data() Sample Data:       [ 18 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 225 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S filter 20 um surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 199 taxa and 15 samples ]
sample_data() Sample Data:       [ 15 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 199 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 16S plastid 0.2 um surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 112 taxa and 11 samples ]
sample_data() Sample Data:       [ 11 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 112 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 16S plastid 3 um surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 142 taxa and 16 samples ]
sample_data() Sample Data:       [ 16 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 142 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 16S plastid 20 um surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 120 taxa and 13 samples ]
sample_data() Sample Data:       [ 13 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 120 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S sort pico surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 65 taxa and 8 samples ]
sample_data() Sample Data:       [ 8 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 65 taxa by 8 taxonomic ranks ]
============================
Phyloseq - 18S sort nano surface
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 70 taxa and 8 samples ]
sample_data() Sample Data:       [ 8 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 70 taxa by 8 taxonomic ranks ]
============================

Normalize and transform to long form

for (one_sample_type in sample_type_surface) {
    
    cat(one_sample_type)
    cat("\n============================")
    
    ps[[one_sample_type]] <- phyloseq_normalize_median(ps[[one_sample_type]])
    
    long[[one_sample_type]] <- phyloseq_transform_to_long(ps[[one_sample_type]])
    
    cat("\n")
    
}
18S filter surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 383 taxa and 50 samples ]
sample_data() Sample Data:       [ 50 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 383 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  23194
16S plastid surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 236 taxa and 40 samples ]
sample_data() Sample Data:       [ 40 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 236 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  28885
18S sort surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 114 taxa and 16 samples ]
sample_data() Sample Data:       [ 16 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 114 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  27275
18S filter 0.2 um surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 187 taxa and 17 samples ]
sample_data() Sample Data:       [ 17 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 187 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  14645
18S filter 3 um surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 225 taxa and 18 samples ]
sample_data() Sample Data:       [ 18 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 225 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  24783
18S filter 20 um surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 199 taxa and 15 samples ]
sample_data() Sample Data:       [ 15 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 199 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  29427
16S plastid 0.2 um surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 112 taxa and 11 samples ]
sample_data() Sample Data:       [ 11 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 112 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  28471
16S plastid 3 um surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 142 taxa and 16 samples ]
sample_data() Sample Data:       [ 16 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 142 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  31801
16S plastid 20 um surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 120 taxa and 13 samples ]
sample_data() Sample Data:       [ 13 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 120 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  25641
18S sort pico surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 65 taxa and 8 samples ]
sample_data() Sample Data:       [ 8 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 65 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  33258
18S sort nano surface
============================
========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 70 taxa and 8 samples ]
sample_data() Sample Data:       [ 8 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 70 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  21650

List of classes

classes <- data.frame(division = NULL, class = NULL)

for (one_sample_type in sample_type_surface[1:3]) {
    classes <- bind_rows(classes, select(long[[one_sample_type]], division, class))
}

classes <- classes %>% distinct(division, class) %>% arrange(division, class)

# print(classes, n=50)
knitr::kable(classes)
division class
Chlorophyta Chlorophyceae
Chlorophyta Mamiellophyceae
Chlorophyta Palmophyllophyceae
Chlorophyta Prasino-Clade-V
Chlorophyta Pyramimonadophyceae
Chlorophyta Trebouxiophyceae
Chlorophyta Ulvophyceae
Cryptophyta Cryptophyceae
Haptophyta Prymnesiophyceae
Ochrophyta Bacillariophyta
Ochrophyta Bolidophyceae
Ochrophyta Chrysophyceae
Ochrophyta Dictyochophyceae
Ochrophyta MOCH-1
Ochrophyta MOCH-2
Ochrophyta Pelagophyceae
Ochrophyta Phaeophyceae
Ochrophyta Xanthophyceae
Rhodophyta Bangiophyceae
Rhodophyta Florideophyceae

Treemaps

treemap_class <- list()
treemap_genus <- list()

for (one_sample_type in sample_type_surface) {
    
    treemap_class[[one_sample_type]] <- phyloseq_long_treemap(long[[one_sample_type]], division, class, str_c(one_sample_type, " - Class"), colors = class_colors)
    treemap_genus[[one_sample_type]] <- phyloseq_long_treemap(long[[one_sample_type]], class, genus, str_c(one_sample_type, " - Genus"), colors = genus_colors)
    
}

ASVs bargraphs

bargraph_asv <- list()
bargraph_species <- list()

for (one_sample_type in sample_type_surface) {
    
    bargraph_asv[[one_sample_type]] <- phyloseq_long_bargraph(long[[one_sample_type]], text_scaling = 0.75, n_bars = 20, use_asv = TRUE, title = one_sample_type, 
        taxo_level_fill = class, taxo_colors_fill = class_colors)
    bargraph_species[[one_sample_type]] <- phyloseq_long_bargraph(long[[one_sample_type]], text_scaling = 0.75, n_bars = 20, use_asv = FALSE, title = one_sample_type, 
        taxo_level_fill = class, taxo_colors_fill = class_colors)
    
}

## Barplots per sample

bargraph_sample <- list()

for (one_sample_type in sample_type_surface[4:11]) {
    
    bargraph_sample[[one_sample_type]] <- plot_bar(ps[[one_sample_type]], x = "sample_label", fill = "class") + geom_bar(aes(color = class, fill = class), 
        stat = "identity", position = "stack") + ggtitle(str_c("Class level - ", one_sample_type)) + theme(axis.text.y = element_text(size = 10)) + 
        theme(axis.text.x = element_text(angle = 0, hjust = 0.5)) + coord_flip() + scale_fill_viridis_d() + scale_color_viridis_d()
    print(bargraph_sample[[one_sample_type]])
}

Heatmaps

Filter : Dictyo / Chrysophyceae /Pelago /Bacili / Crypto / Pyrami / Mamiello

Class

Most abundant 10%

heatmap_class_abundant <- list()

for (one_sample_type in sample_type_surface[4:11]) {
    
    ps_heat <- tax_glom(ps[[one_sample_type]], taxrank = "class") %>% phyloseq_filter_abundant_taxa(fraction_min = 0.1)
    
    heatmap_class_abundant[[one_sample_type]] <- plot_heatmap(ps_heat, method = "NMDS", distance = "bray", taxa.label = "class", taxa.order = "division", 
        sample.label = "sample_label", sample.order = "sample_label", low = "beige", high = "red", na.value = "beige", trans = NULL, title = one_sample_type) + 
        xlab("") + ylab("")
    
    # plot(heatmap(otu_table(ps_heat)))
    
    print(heatmap_class_abundant[[one_sample_type]])
    
}

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 7 taxa and 17 samples ]
sample_data() Sample Data:       [ 17 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 7 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  13806


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 7 taxa and 18 samples ]
sample_data() Sample Data:       [ 18 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 7 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  23366


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 5 taxa and 15 samples ]
sample_data() Sample Data:       [ 15 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 5 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  27860


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 4 taxa and 11 samples ]
sample_data() Sample Data:       [ 11 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 4 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  27592


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 5 taxa and 16 samples ]
sample_data() Sample Data:       [ 16 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 5 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  31460


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 4 taxa and 13 samples ]
sample_data() Sample Data:       [ 13 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 4 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  24881


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 4 taxa and 8 samples ]
sample_data() Sample Data:       [ 8 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 4 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  32016


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 4 taxa and 8 samples ]
sample_data() Sample Data:       [ 8 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 4 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  21054

Selected

class_selected <- c("Dictyochophyceae", "Chrysophyceae", "Pelagophyceae", "Bacillariophyta", "Prymnesiophyceae", "Cryptophyceae", "Pyramimonadophyceae", 
    "Mamiellophyceae")

heatmap_class_selected <- list()

for (one_sample_type in sample_type_surface[4:11]) {
    # for (one_sample_type in sample_type_surface[4:4]) {
    reads_max <- case_when(str_detect(one_sample_type, "18S filter") ~ 10000, str_detect(one_sample_type, "16S plastid") ~ 30000, str_detect(one_sample_type, 
        "18S sort") ~ 10000)
    
    if (str_detect(one_sample_type, "18S sort")) {
        class_selected <- c("Pelagophyceae", "Bacillariophyta", "Prymnesiophyceae", "Cryptophyceae", "Mamiellophyceae")
    }
    
    ps_heat <- tax_glom(ps[[one_sample_type]], taxrank = "class") %>% subset_taxa(class %in% class_selected)
    
    # Try to order by division and class...  tax_table <- data.frame(tax_table(ps_heat)@.Data) taxa_names(ps_heat) <- str_c(tax_table$division,
    # tax_table$class, sep=' - ')
    
    gg <- plot_heatmap(ps_heat, method = "NMDS", distance = "bray", taxa.label = "class", taxa.order = "class", sample.label = "sample_label", sample.order = "sample_label", 
        low = "beige", high = "red", na.value = "gray95", trans = NULL, title = one_sample_type) + theme(axis.text.x = element_text(angle = 45, 
        hjust = 1, vjust = 1), axis.title.x = element_blank(), axis.title.y = element_blank(), panel.background = element_rect(fill = "grey50"), 
        panel.grid.major = element_blank()) + scale_fill_gradient(limits = c(0, reads_max), low = "beige", high = "red", na.value = "red")
    
    if (str_detect(one_sample_type, "18S filter 0.2")) 
        gg <- gg + expand_limits(y = c(0.5, 9)) + geom_vline(xintercept = c(3.5, 9.5, 12.5)) + annotate(geom = "text", label = c("summer", "fall", 
            "spring", "summer"), x = c(2, 6.5, 11, 15), y = 8.65, color = "white", fill = "grey50", hjust = 0.5, vjust = 0, size = 4.5, label.r = unit(0.2, 
            "lines"))
    
    
    if (one_sample_type == "18S filter 3 um surface") 
        gg <- gg + expand_limits(y = c(0.5, 9)) + geom_vline(xintercept = c(4.5, 10.5, 13.5)) + annotate(geom = "text", label = c("summer", "fall", 
            "spring", "summer"), x = c(2.5, 7.5, 12, 16), y = 8.65, color = "white", fill = "grey50", hjust = 0.5, vjust = 0, size = 4.5, label.r = unit(0.2, 
            "lines"))
    
    if (one_sample_type == "18S filter 20 um surface") 
        gg <- gg + expand_limits(y = c(0.5, 9)) + geom_vline(xintercept = c(4.5, 9.5)) + annotate(geom = "text", label = c("summer", "fall", "summer"), 
            x = c(2.5, 7, 12.5), y = 8.65, color = "white", fill = "grey50", hjust = 0.5, vjust = 0, size = 4.5, label.r = unit(0.2, "lines"))
    
    
    # plot(heatmap(otu_table(ps_heat))) , trans = scales::log_trans(10)
    
    print(gg)
    
    heatmap_class_selected[[one_sample_type]] <- gg
    
}

Species

Most abundant

heatmap_genus_abundant <- list()

for (one_sample_type in sample_type_surface[4:11]) {
    
    ps_heat <- tax_glom(ps[[one_sample_type]], taxrank = "species") %>% phyloseq_filter_abundant_taxa(fraction_min = 0.1)
    
    heatmap_genus_abundant[[one_sample_type]] <- plot_heatmap(ps_heat, method = "NMDS", distance = "bray", taxa.label = "species", taxa.order = "division", 
        sample.label = "sample_label", sample.order = "sample_label", low = "beige", high = "red", na.value = "beige", title = one_sample_type)
    
    print(heatmap_genus_abundant[[one_sample_type]])
    
}

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 10 taxa and 17 samples ]
sample_data() Sample Data:       [ 17 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 10 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  11702


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 8 taxa and 18 samples ]
sample_data() Sample Data:       [ 18 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 8 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  20199


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 11 taxa and 15 samples ]
sample_data() Sample Data:       [ 15 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 11 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  26302


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 6 taxa and 11 samples ]
sample_data() Sample Data:       [ 11 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 6 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  27286


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 9 taxa and 16 samples ]
sample_data() Sample Data:       [ 16 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 9 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  30697


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 8 taxa and 13 samples ]
sample_data() Sample Data:       [ 13 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 8 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  24093


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 5 taxa and 8 samples ]
sample_data() Sample Data:       [ 8 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 5 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  28373


========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 6 taxa and 8 samples ]
sample_data() Sample Data:       [ 8 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 6 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  19513

Selected

species_selected <- c("Thalassiosira_minima", "Fragilariopsis_cylindrus", "Minidiscus_sp.", "Chaetoceros_neogracilis", "Porosira_glacialis", "Coretrhon_inerme", 
    "Palmaria_palmata", "Pseudo-nitzchia_seriata", "Micromonas_polaris", "Micromonas_clade_B3", "Bathycoccus_prasinos", "Pyramimonas_gelidicola", 
    "Geminigera_cryophila", "Pelagophyceae_XXX_sp.", "Phaeocystis_antarctica")


heatmap_species_selected <- list()

for (one_sample_type in sample_type_surface[4:11]) {
    # for (one_sample_type in sample_type_surface[4:4]) {
    reads_max <- case_when(str_detect(one_sample_type, "18S filter") ~ 10000, str_detect(one_sample_type, "16S plastid") ~ 5000, str_detect(one_sample_type, 
        "18S sort") ~ 10000)
    if (str_detect(one_sample_type, "18S sort")) {
        species_selected <- c("Thalassiosira_minima", "Fragilariopsis_cylindrus", "Minidiscus_sp.", "Chaetoceros_neogracilis", "Porosira_glacialis", 
            "Coretrhon_inerme", "Palmaria_palmata", "Pseudo-nitzchia_seriata", "Micromonas_polaris", "Geminigera_cryophila", "Pelagophyceae_XXX_sp.", 
            "Phaeocystis_antarctica")
    }
    
    
    
    ps_heat <- tax_glom(ps[[one_sample_type]], taxrank = "species") %>% subset_taxa(species %in% species_selected)
    
    # Try to order by division and species...  tax_table <- data.frame(tax_table(ps_heat)@.Data) taxa_names(ps_heat) <- str_c(tax_table$division,
    # tax_table$species, sep=' - ')
    
    gg <- plot_heatmap(ps_heat, method = "NMDS", distance = "bray", taxa.label = "species", taxa.order = "class", sample.label = "sample_label", 
        sample.order = "sample_label", low = "beige", high = "red", na.value = "gray95", trans = NULL, title = one_sample_type) + theme(axis.text.x = element_text(angle = 45, 
        hjust = 1, vjust = 1), axis.title.x = element_blank(), axis.title.y = element_blank(), panel.background = element_rect(fill = "grey50"), 
        panel.grid.major = element_blank()) + scale_fill_gradient(limits = c(0, reads_max), low = "beige", high = "red", na.value = "red")
    
    if (str_detect(one_sample_type, "18S filter 0.2")) 
        gg <- gg + geom_vline(xintercept = c(3.5, 9.5, 12.5))
    
    if (one_sample_type == "18S filter 3 um surface") 
        gg <- gg + geom_vline(xintercept = c(4.5, 10.5, 13.5))
    
    if (one_sample_type == "18S filter 20 um surface") 
        gg <- gg + geom_vline(xintercept = c(4.5, 9.5))
    
    
    
    # plot(heatmap(otu_table(ps_heat))) , trans = scales::log_trans(10)
    
    print(gg)
    
    heatmap_species_selected[[one_sample_type]] <- gg
    
}

NMDS

Apply to all samples

nmds_sample <- list()

for (one_sample_type in sample_type_surface[1:3]) {
    
    one_ps <- ps[[one_sample_type]] %>% tax_glom(taxrank = "species")
    
    nmds_sample[[one_sample_type]] <- phyloseq_nmds(one_ps, title = one_sample_type, sample_color = season, sample_shape = fraction_name_original, 
        taxo_level = class, taxo_colors = class_colors)
}
Square root transformation
Wisconsin double standardization
Run 0 stress 0.1714216 
Run 1 stress 0.1758561 
Run 2 stress 0.1717706 
... Procrustes: rmse 0.007217713  max resid 0.02514368 
Run 3 stress 0.1759724 
Run 4 stress 0.1714241 
... Procrustes: rmse 0.0003112062  max resid 0.001279752 
... Similar to previous best
Run 5 stress 0.1713535 
... New best solution
... Procrustes: rmse 0.003791301  max resid 0.01300957 
Run 6 stress 0.1713543 
... Procrustes: rmse 0.0002738691  max resid 0.00105073 
... Similar to previous best
Run 7 stress 0.1714036 
... Procrustes: rmse 0.003856787  max resid 0.01498517 
Run 8 stress 0.1758565 
Run 9 stress 0.1760002 
Run 10 stress 0.1713761 
... Procrustes: rmse 0.002503714  max resid 0.01167642 
Run 11 stress 0.190753 
Run 12 stress 0.1758566 
Run 13 stress 0.1778862 
Run 14 stress 0.1776749 
Run 15 stress 0.1937439 
Run 16 stress 0.1713777 
... Procrustes: rmse 0.002296881  max resid 0.01177999 
Run 17 stress 0.1759718 
Run 18 stress 0.1713972 
... Procrustes: rmse 0.002984647  max resid 0.0119656 
Run 19 stress 0.1866215 
Run 20 stress 0.1904543 
*** Solution reached
[1] 3

Call:
metaMDS(comm = veganifyOTU(physeq), distance = distance) 

global Multidimensional Scaling using monoMDS

Data:     wisconsin(sqrt(veganifyOTU(physeq))) 
Distance: bray 

Dimensions: 2 
Stress:     0.1713535 
Stress type 1, weak ties
Two convergent solutions found after 20 tries
Scaling: centring, PC rotation, halfchange scaling 
Species: expanded scores based on 'wisconsin(sqrt(veganifyOTU(physeq)))' 

Square root transformation
Wisconsin double standardization
Run 0 stress 0.1477193 
Run 1 stress 0.151694 
Run 2 stress 0.1515777 
Run 3 stress 0.1720669 
Run 4 stress 0.1476132 
... New best solution
... Procrustes: rmse 0.008944154  max resid 0.03744427 
Run 5 stress 0.1743639 
Run 6 stress 0.1651081 
Run 7 stress 0.1531319 
Run 8 stress 0.1490493 
Run 9 stress 0.165109 
Run 10 stress 0.1651081 
Run 11 stress 0.1925171 
Run 12 stress 0.162316 
Run 13 stress 0.1737626 
Run 14 stress 0.1720647 
Run 15 stress 0.1519371 
Run 16 stress 0.1736789 
Run 17 stress 0.1720671 
Run 18 stress 0.1874055 
Run 19 stress 0.150668 
Run 20 stress 0.1742395 
*** No convergence -- monoMDS stopping criteria:
    20: stress ratio > sratmax
[1] 3

Call:
metaMDS(comm = veganifyOTU(physeq), distance = distance) 

global Multidimensional Scaling using monoMDS

Data:     wisconsin(sqrt(veganifyOTU(physeq))) 
Distance: bray 

Dimensions: 2 
Stress:     0.1476132 
Stress type 1, weak ties
No convergent solutions - best solution after 20 tries
Scaling: centring, PC rotation, halfchange scaling 
Species: expanded scores based on 'wisconsin(sqrt(veganifyOTU(physeq)))' 

Square root transformation
Wisconsin double standardization
Run 0 stress 0.05090316 
Run 1 stress 0.0524764 
Run 2 stress 0.05145132 
Run 3 stress 0.05736205 
Run 4 stress 0.05466462 
Run 5 stress 0.05537261 
Run 6 stress 0.06026908 
Run 7 stress 0.0524764 
Run 8 stress 0.05161248 
Run 9 stress 0.05185409 
Run 10 stress 0.05723175 
Run 11 stress 0.05145131 
Run 12 stress 0.05945005 
Run 13 stress 0.05440615 
Run 14 stress 0.05202902 
Run 15 stress 0.3065991 
Run 16 stress 0.06090273 
Run 17 stress 0.05950989 
Run 18 stress 0.05188958 
Run 19 stress 0.05220003 
Run 20 stress 0.05185435 
*** No convergence -- monoMDS stopping criteria:
    20: stress ratio > sratmax
[1] 3

Call:
metaMDS(comm = veganifyOTU(physeq), distance = distance) 

global Multidimensional Scaling using monoMDS

Data:     wisconsin(sqrt(veganifyOTU(physeq))) 
Distance: bray 

Dimensions: 2 
Stress:     0.05090316 
Stress type 1, weak ties
No convergent solutions - best solution after 20 tries
Scaling: centring, PC rotation, halfchange scaling 
Species: expanded scores based on 'wisconsin(sqrt(veganifyOTU(physeq)))' 

Vertical profile

  • Station 6 - 2015-01-16
  • Very important, must remove taxa that are not present in the filtered samples

Filter the data

sample_type_profile <- str_c(sample_type_all, " profile")

for (one_sample_type in sample_type_all) {
    
    one_sample_type_profile = str_c(one_sample_type, " profile")
    
    ps[[one_sample_type_profile]] <- ps[[one_sample_type]] %>% subset_samples(station_id == "6") %>% subset_samples(date == "2015-01-16") %>% filter_taxa(function(x) sum(x) > 
        0, TRUE) %>% phyloseq_normalize_median()
    
    # Rename the samples
    
    if (!str_detect(one_sample_type_profile, "sort")) {
        sample_names(ps[[one_sample_type_profile]]) <- str_c(as.character(sample_data(ps[[one_sample_type_profile]])$depth), "m", as.character(sample_data(ps[[one_sample_type_profile]])$fraction_min), 
            sep = "_")
    } else {
        sample_names(ps[[one_sample_type_profile]]) <- str_c(as.character(sample_data(ps[[one_sample_type_profile]])$depth), "m", as.character(sample_data(ps[[one_sample_type_profile]])$fraction_name), 
            sep = "_")
    }
    
    
    print(glue("Phyloseq - {one_sample_type_profile}"))
    print(ps[[one_sample_type_profile]])
    cat("============================\n")
    
}

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 172 taxa and 15 samples ]
sample_data() Sample Data:       [ 15 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 172 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  43461Phyloseq - 18S filter profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 172 taxa and 15 samples ]
sample_data() Sample Data:       [ 15 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 172 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 107 taxa and 15 samples ]
sample_data() Sample Data:       [ 15 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 107 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  41130Phyloseq - 16S plastid profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 107 taxa and 15 samples ]
sample_data() Sample Data:       [ 15 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 107 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 94 taxa and 10 samples ]
sample_data() Sample Data:       [ 10 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 94 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  29304Phyloseq - 18S sort profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 94 taxa and 10 samples ]
sample_data() Sample Data:       [ 10 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 94 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 90 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 90 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  30257Phyloseq - 18S filter 0.2 um profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 90 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 90 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 84 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 84 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  31205Phyloseq - 18S filter 3 um profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 84 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 84 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 121 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 121 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  58797Phyloseq - 18S filter 20 um profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 121 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 121 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 46 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 46 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  40267Phyloseq - 16S plastid 0.2 um profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 46 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 46 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 62 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 62 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  46172Phyloseq - 16S plastid 3 um profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 62 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 62 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 74 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 74 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  47020Phyloseq - 16S plastid 20 um profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 74 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 60 sample variables ]
tax_table()   Taxonomy Table:    [ 74 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 63 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 63 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  29412Phyloseq - 18S sort pico profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 63 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 63 taxa by 8 taxonomic ranks ]
============================

========== 
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 46 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 46 taxa by 8 taxonomic ranks ]

==========
The median number of reads used for normalization is  28502Phyloseq - 18S sort nano profile
phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 46 taxa and 5 samples ]
sample_data() Sample Data:       [ 5 samples by 61 sample variables ]
tax_table()   Taxonomy Table:    [ 46 taxa by 8 taxonomic ranks ]
============================

Barplots per depth

bargraph_sample <- list()

for (one_sample_type in sample_type_profile[4:11]) {
    
    bargraph_sample[[one_sample_type]] <- plot_bar(ps[[one_sample_type]], x = "depth", fill = "class") + geom_bar(aes(color = class, fill = class), 
        stat = "identity", position = "stack") + ggtitle(str_c("Class level - ", one_sample_type)) + theme(axis.text.y = element_text(size = 10)) + 
        theme(axis.text.x = element_text(angle = 0, hjust = 0.5)) + coord_flip() + # scale_fill_viridis_d() + scale_color_viridis_d() +
    scale_fill_manual(values = class_colors) + scale_color_manual(values = class_colors) + scale_x_reverse() + xlab("Depth (m)") + ylab("Reads") + 
        theme_bw()
    
    print(bargraph_sample[[one_sample_type]])
}

Compare the contributions of CLASS and SPECIES using the different methods

Sample by sample comparison

  • Each dot corresponds to the relative contribution of the taxonomic level considered for a sample for which both 18S and 16S has been performed
long_species_sample <- list()
long_class_sample <- list()

for (one_sample_type in sample_type) {
    ps_one <- phyloseq_normalize_percent(ps[[one_sample_type]])
    
    long_one <- phyloseq_transform_to_long(ps_one) %>% filter(!is.na(fraction_name_original)) %>% group_by(date, station_id, depth, fraction_name_original, 
        division, class, order, family, genus, species) %>% summarize(n_reads = sum(n_reads)) %>% ungroup()
    
    long_species_sample[[one_sample_type]] <- long_one
    
    long_one <- phyloseq_transform_to_long(ps_one) %>% filter(!is.na(fraction_name_original)) %>% group_by(date, station_id, depth, fraction_name_original, 
        division, class) %>% summarize(n_reads = sum(n_reads)) %>% ungroup()
    
    long_class_sample[[one_sample_type]] <- long_one
}

long_compare_species_18S_16S <- full_join(rename(long_species_sample[["18S filter"]], n_reads_18S_filter = n_reads), rename(long_species_sample[["16S plastid"]], 
    n_reads_16S_plastid = n_reads))

ggplot(long_compare_species_18S_16S, aes(x = n_reads_18S_filter, y = n_reads_16S_plastid)) + geom_point(aes(color = class)) + scale_color_manual(values = class_colors) + 
    ggtitle("Species")

long_compare_class_18S_16S <- long_compare_species_18S_16S %>% group_by(date, station_id, depth, fraction_name_original, division, class) %>% summarize(n_reads_18S_filter = sum(n_reads_18S_filter, 
    na.rm = TRUE), n_reads_16S_plastid = sum(n_reads_16S_plastid, na.rm = TRUE))

ggplot(long_compare_class_18S_16S, aes(x = n_reads_18S_filter, y = n_reads_16S_plastid)) + geom_point(aes(color = class)) + scale_color_manual(values = class_colors) + 
    ggtitle("Classes")

Define upset function

  • Needs only to have 0 and 1 in the matrix
plot_upset_long <- function(long_comparison, file_name) {
    
    long_upset <- long_comparison %>% mutate_if(is.numeric, funs(case_when(is.na(.) ~ 0, TRUE ~ 1))) %>% as.data.frame()
    
    fig_upset <- UpSetR::upset(long_upset, empty.intersections = "on", number.angles = 30, point.size = 12, line.size = 4, mainbar.y.label = "Taxa number", 
        sets.x.label = "Taxa #", order.by = "freq", text.scale = c(5), mb.ratio = c(0.7, 0.3))
    
    # text.scale = c(intersection size title, intersection size tick labels, set size title, set size tick labels, set names, numbers above bars)
    
    print(fig_upset)
    png(file_name, width = 2000, height = 1200, units = "px")
    print(fig_upset)
    dev.off()
    
    return(fig_upset)
}

Global comparison of species found with the 3 methods

  • Compute table of number of samples for each species (rows) vs the three methods (columns)

  • Only keep

    • 2015 samples because it is the only dataset for which we have the three types of samples
    • 0.2 and 3 um fractions (to be comparable with sorting)
  • Remove species that contains _X

long_species <- list()
long_genus <- list()
long_class <- list()
fig_upset_list <- list()

for (one_sample_type in sample_type) {
    long_one <- long_species_sample[[one_sample_type]] %>% filter(date >= as.Date("2015-01-01")) %>% filter(!str_detect(species, "_X")) %>% filter(fraction_name_original != 
        "> 20 um") %>% group_by(division, class, order, family, genus, species) %>% summarize(n_reads = sum(n_reads), n_samples = n()) %>% rename_at(vars(contains("n_")), 
        funs(str_c(., str_replace_all(one_sample_type, " ", "_"), sep = "_"))) %>% ungroup()
    
    long_species[[one_sample_type]] <- long_one
    
    long_one <- long_species_sample[[one_sample_type]] %>% filter(date >= as.Date("2015-01-01")) %>% filter(!str_detect(species, "_X")) %>% filter(fraction_name_original != 
        "> 20 um") %>% group_by(division, class, order, family, genus) %>% summarize(n_reads = sum(n_reads), n_samples = n()) %>% rename_at(vars(contains("n_")), 
        funs(str_c(., str_replace_all(one_sample_type, " ", "_"), sep = "_"))) %>% ungroup()
    
    long_genus[[one_sample_type]] <- long_one
    
    long_one <- long_class_sample[[one_sample_type]] %>% filter(date >= as.Date("2015-01-01")) %>% filter(fraction_name_original != "> 20 um") %>% 
        group_by(division, class) %>% summarize(n_reads = sum(n_reads), n_samples = n()) %>% rename_at(vars(contains("n_")), funs(str_c(., str_replace_all(one_sample_type, 
        " ", "_"), sep = "_"))) %>% ungroup()
    
    long_class[[one_sample_type]] <- long_one
    
}

long_class_comparison <- long_class %>% purrr::reduce(full_join)

long_genus_comparison <- long_genus %>% purrr::reduce(full_join)

long_species_comparison <- long_species %>% purrr::reduce(full_join)

# Class ----------

cat("Class not found in one type of sample\n")
Class not found in one type of sample
cat("18S filter\n")
18S filter
kable(filter(long_class_comparison, is.na(n_samples_18S_filter)))
division class n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Prasino-Clade-V NA NA 0.1765574 27 NA NA
cat("18S sort\n")
18S sort
kable(filter(long_class_comparison, is.na(n_samples_18S_sort)))
division class n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Trebouxiophyceae 0.0004002 3 0.0004331 3 NA NA
Rhodophyta Florideophyceae 0.0736053 27 0.0017249 9 NA NA
Chlorophyta Prasino-Clade-V NA NA 0.1765574 27 NA NA
cat("16S filter\n")
16S filter
kable(filter(long_class_comparison, is.na(n_samples_16S_plastid)))
division class n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Ulvophyceae 0.0197181 22 NA NA 0.3029099 1
Ochrophyta MOCH-2 0.0314126 26 NA NA 0.0383595 9
cat("Genus  found in the three types of samples\n")
Genus  found in the three types of samples
cat("18S filter\n")
18S filter
kable(filter(long_genus_comparison, (!is.na(n_samples_18S_filter) & !is.na(n_samples_18S_sort) & !is.na(n_samples_16S_plastid))))
division class order family genus n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Mamiellophyceae Mamiellales Bathycoccaceae Bathycoccus 0.2047292 30 0.0011887 2 0.9280385 21
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Mantoniella 0.0004832 1 0.0272823 22 0.0013399 1
Chlorophyta Palmophyllophyceae Prasinococcales Prasinococcales-Clade-B Prasinoderma 0.0280184 29 0.0181827 22 0.0015760 1
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas 0.5899594 65 4.5264901 30 1.1062379 22
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Geminigera 8.3011827 33 0.0000594 1 3.3903198 24
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis 0.8712445 35 4.5158115 28 7.9617359 50
Haptophyta Prymnesiophyceae Prymnesiales Chrysochromulinaceae Chrysochromulina 0.0138549 18 6.1388612 28 0.3357026 20
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros 0.4170779 55 0.1027584 24 3.7710088 35
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus 4.8424843 39 2.8469791 27 4.2101937 24
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira 2.5663612 34 1.0900795 24 0.0336542 2
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira 3.1823140 68 0.0862048 12 1.3921588 38
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis 4.1161364 53 1.0791966 28 3.8921612 41
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia 0.0681147 25 0.0481983 18 0.0353992 7
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma 0.1638104 34 0.1899858 32 0.4149332 22
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Florenciella 0.0524154 29 0.0016350 3 0.0103929 8
# Genus ----------

cat("Genus only found in one type of sample\n")
Genus only found in one type of sample
cat("18S filter\n")
18S filter
kable(filter(long_genus_comparison, (is.na(n_samples_18S_sort) & is.na(n_samples_16S_plastid))))
division class order family genus n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Chlorophyceae Chaetopeltidales Chaetopeltidaceae Planophila 0.0003221 1 NA NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Haematococcus 0.0001605 1 NA NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Pleurastrum 0.0009742 3 NA NA NA NA
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Desmococcus 0.0000585 1 NA NA NA NA
Chlorophyta Trebouxiophyceae Watanabea-Clade Watanabea-Clade_X Chloroidium 0.0001530 1 NA NA NA NA
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Chlorothrix 0.0018758 2 NA NA NA NA
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Monostroma 0.0150017 17 NA NA NA NA
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Dilabifilum 0.0002731 1 NA NA NA NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Teleaulax 0.0000661 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Licmophora 0.0007432 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Pteroncola 0.0007406 4 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Thalassionema 0.0011473 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Eucampia 0.0005298 3 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Shionodiscus 0.0173100 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Actinocyclus 0.0017113 4 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Rhizosolenia 0.0000685 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Stellarima 0.0001769 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Amphora 0.0057413 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cylindrotheca 0.0002630 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella 0.0041444 12 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Encyonema 0.0016082 7 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Haslea 0.0011843 4 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula 0.0008912 4 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Nitzschia 0.0002409 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pauliella 0.0002739 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pleurosigma 0.0011816 3 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudogomphonema 0.0059717 11 NA NA NA NA
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3A 0.0097964 9 NA NA NA NA
Ochrophyta Chrysophyceae Chrysophyceae_X Chrysophyceae_Clade-C Spumella 0.0144548 5 NA NA NA NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Pseudopedinella 0.0001042 1 NA NA NA NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Pylaiella 0.0005950 1 NA NA NA NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Hemineura 0.0000743 1 NA NA NA NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Phycodrys 0.0000850 1 NA NA NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Hapalidiaceae 0.0003964 1 NA NA NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Mesophyllum 0.0253548 23 NA NA NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Synarthrophyton 0.0007193 2 NA NA NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Stenogramme 0.0015735 2 NA NA NA NA
Rhodophyta Florideophyceae Gracilariales Gracilariales_X Curdiea 0.0011262 4 NA NA NA NA
Rhodophyta Florideophyceae Halymeniales Halymeniales_X Pachymenia 0.0000992 1 NA NA NA NA
Rhodophyta Florideophyceae Plocamiales Plocamiales_X Trematocarpus 0.0004336 2 NA NA NA NA
cat("18S sort\n")
18S sort
kable(filter(long_genus_comparison, (is.na(n_samples_18S_filter) & is.na(n_samples_16S_plastid))))
division class order family genus n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Skeletonema NA NA NA NA 0.0000463 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Bacillaria NA NA NA NA 0.0002977 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Luka_AeN707 NA NA NA NA 0.0011928 2
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonadaceae_clade_A NA NA NA NA 0.0002917 1
cat("16S filter\n")
16S filter
kable(filter(long_genus_comparison, (is.na(n_samples_18S_filter) & is.na(n_samples_18S_sort))))
division class order family genus n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Oophila NA NA 0.0001469 2 NA NA
Chlorophyta Trebouxiophyceae Chlorellales Chlorellales_X Chlorella NA NA 0.0001729 1 NA NA
Haptophyta Prymnesiophyceae Prymnesiales Prymnesiaceae Dicrateria NA NA 0.0064689 17 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Conticribra NA NA 0.0001386 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Lauderia NA NA 0.0000594 1 NA NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Helicopedinella NA NA 0.0073091 5 NA NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Mesopedinella NA NA 0.0004326 3 NA NA
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Aureococcus NA NA 0.4391393 28 NA NA
Rhodophyta Florideophyceae Ahnfeltiales Ahnfeltiaceae Ahnfeltia NA NA 0.0001100 1 NA NA
cat("Species  found in the three types of samples\n")
Species  found in the three types of samples
cat("18S filter\n")
18S filter
kable(filter(long_species_comparison, (!is.na(n_samples_18S_filter) & !is.na(n_samples_18S_sort) & !is.na(n_samples_16S_plastid))))
division class order family genus species n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Mamiellophyceae Mamiellales Bathycoccaceae Bathycoccus Bathycoccus_prasinos 0.2047292 30 0.0011887 2 0.9280385 21
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Mantoniella Mantoniella_squamata 0.0004832 1 0.0272823 22 0.0013399 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Geminigera Geminigera_cryophila 8.3011827 33 0.0000594 1 3.3903198 24
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_sp. 0.0004761 1 4.5158115 28 0.0948484 9
Haptophyta Prymnesiophyceae Prymnesiales Chrysochromulinaceae Chrysochromulina Chrysochromulina_sp. 0.0138549 18 6.1388612 28 0.3357026 20
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus Minidiscus_sp. 4.8105895 33 2.8469791 27 4.2101937 24
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_glacialis 2.5659854 33 1.0900795 24 0.0336542 2
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_sp. 1.3705387 32 0.0860340 11 0.7088026 12
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis Fragilariopsis_cylindrus 4.0610552 33 1.0791966 28 3.8587955 36
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Florenciella Florenciella_parvula 0.0524154 29 0.0016350 3 0.0103929 8
long_genus_comparison_upset <- long_genus_comparison %>% select(genus, contains("samples")) %>% rename_at(vars(contains("n_")), funs(str_replace_all(., 
    c(n_samples_ = "", `_` = " ", plastid = "filter"))))

fig_upset_list[["method genus"]] <- plot_upset_long(long_genus_comparison_upset, "../fig/upset_method_genus.png")

# Species ----------


cat("Species only found in one type of sample\n")
Species only found in one type of sample
cat("18S filter\n")
18S filter
kable(filter(long_species_comparison, (is.na(n_samples_18S_sort) & is.na(n_samples_16S_plastid))))
division class order family genus species n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Chlorophyceae Chaetopeltidales Chaetopeltidaceae Planophila Planophila_sp. 0.0003221 1 NA NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_acidophila 0.0001343 1 NA NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_hedleyi 0.0006203 2 NA NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_kuwadae 0.0013584 6 NA NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Haematococcus Haematococcus_zimbabwiensis 0.0001605 1 NA NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Pleurastrum Pleurastrum_sp. 0.0009742 3 NA NA NA NA
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Desmococcus Desmococcus_endolithicus 0.0000585 1 NA NA NA NA
Chlorophyta Trebouxiophyceae Watanabea-Clade Watanabea-Clade_X Chloroidium Chloroidium_ellipsoideum 0.0001530 1 NA NA NA NA
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Chlorothrix Chlorothrix_sp. 0.0018758 2 NA NA NA NA
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Monostroma Monostroma_grevillei 0.0150017 17 NA NA NA NA
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Dilabifilum Dilabifilum_sp. 0.0002731 1 NA NA NA NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Falcomonas Falcomonas_sp. 0.0002160 2 NA NA NA NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Hemiselmis Hemiselmis_tepida 0.0061607 7 NA NA NA NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Teleaulax Teleaulax_sp. 0.0000661 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Grammonema Grammonema_striatula 0.0003498 3 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Licmophora Licmophora_grandis 0.0007432 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Pteroncola Pteroncola_inane 0.0007406 4 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Thalassionema Thalassionema_frauenfeldii 0.0011473 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_peruvianus 0.0003611 3 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Eucampia Eucampia_antarctica 0.0005298 3 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus Minidiscus_trioculatus 0.0318947 6 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Odontella Odontella_aurita 0.0000751 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_pseudodelicatula 0.0003758 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Shionodiscus Shionodiscus_ritscheri 0.0173100 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_antarctica 0.0001088 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_oestrupii 0.0001102 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_tumida 0.0007959 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Actinocyclus Actinocyclus_actinochilus 0.0017113 4 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Corethron Corethron_inerme 0.2140839 33 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Rhizosolenia Rhizosolenia_fallax 0.0000685 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Stellarima Stellarima_microtrias 0.0001769 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Amphora Amphora_proteus 0.0057413 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cylindrotheca Cylindrotheca_closterium 0.0002630 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella Cymbella_gastroides 0.0041444 12 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Encyonema Encyonema_sp. 0.0016082 7 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Haslea Haslea_spicula 0.0011843 4 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_perminuta 0.0000805 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_sp. 0.0008106 3 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Nitzschia Nitzschia_dissipata 0.0001239 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Nitzschia Nitzschia_sp. 0.0001170 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pauliella Pauliella_toeniata 0.0002739 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pleurosigma Pleurosigma_intermedium 0.0011816 3 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia Pseudo-nitzschia_turgidula 0.0001264 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudogomphonema Pseudogomphonema_sp. 0.0059717 11 NA NA NA NA
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3A Parmales_env_3A_sp. 0.0097964 9 NA NA NA NA
Ochrophyta Chrysophyceae Chrysophyceae_X Chrysophyceae_Clade-C Spumella Spumella_elongata 0.0144548 5 NA NA NA NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Pseudopedinella Pseudopedinella_sp. 0.0001042 1 NA NA NA NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Pylaiella Pylaiella_littoralis 0.0005950 1 NA NA NA NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Hemineura Hemineura_frondosa 0.0000743 1 NA NA NA NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Phycodrys Phycodrys_rubens 0.0000850 1 NA NA NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Hapalidiaceae Hapalidiaceae_sp. 0.0003964 1 NA NA NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Mesophyllum Mesophyllum_sp. 0.0253548 23 NA NA NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Synarthrophyton Synarthrophyton_patena 0.0007193 2 NA NA NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Chondrus Chondrus_nipponicus 0.0416973 22 NA NA NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Stenogramme Stenogramme_interrupta 0.0015735 2 NA NA NA NA
Rhodophyta Florideophyceae Gracilariales Gracilariales_X Curdiea Curdiea_codiodes 0.0011262 4 NA NA NA NA
Rhodophyta Florideophyceae Halymeniales Halymeniales_X Pachymenia Pachymenia_orbicularis 0.0000992 1 NA NA NA NA
Rhodophyta Florideophyceae Plocamiales Plocamiales_X Trematocarpus Trematocarpus_fragilis 0.0004336 2 NA NA NA NA
cat("18S sort\n")
18S sort
kable(filter(long_species_comparison, (is.na(n_samples_18S_filter) & is.na(n_samples_16S_plastid))))
division class order family genus species n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Falcomonas Falcomonas_daucoides NA NA NA NA 0.0023399 3
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Hemiselmis Hemiselmis_sp. NA NA NA NA 0.0001032 1
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_pouchetii NA NA NA NA 0.0016326 2
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Skeletonema Skeletonema_sp. NA NA NA NA 0.0000463 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Bacillaria Bacillaria_paxillifer NA NA NA NA 0.0002977 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Luka_AeN707 Luka_AeN707-96_sp. NA NA NA NA 0.0011928 2
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_verruculosa NA NA NA NA 0.0012825 1
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonadaceae_clade_A Pelagomonadaceae_clade_A_sp. NA NA NA NA 0.0002917 1
cat("16S filter\n")
16S filter
kable(filter(long_species_comparison, (is.na(n_samples_18S_filter) & is.na(n_samples_18S_sort))))
division class order family genus species n_reads_18S_filter n_samples_18S_filter n_reads_16S_plastid n_samples_16S_plastid n_reads_18S_sort n_samples_18S_sort
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Oophila Oophila_amblystomatis NA NA 0.0001469 2 NA NA
Chlorophyta Palmophyllophyceae Prasinococcales Prasinococcales-Clade-B Prasinoderma Prasinoderma_coloniale NA NA 0.0181827 22 NA NA
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas Pyramimonas_disomata NA NA 0.0001915 2 NA NA
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas Pyramimonas_sp. NA NA 4.5262986 28 NA NA
Chlorophyta Trebouxiophyceae Chlorellales Chlorellales_X Chlorella Chlorella_vulgaris NA NA 0.0001729 1 NA NA
Haptophyta Prymnesiophyceae Prymnesiales Prymnesiaceae Dicrateria Dicrateria_sp. NA NA 0.0064689 17 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Grammonema Grammonema_striatulum NA NA 0.0003316 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_sp. NA NA 0.1027584 24 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Conticribra Conticribra_weissflogii NA NA 0.0001386 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Lauderia Lauderia_annulata NA NA 0.0000594 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Odontella Odontella_sinensis NA NA 0.1707281 25 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_nordenskioeldii NA NA 0.0001708 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Corethron Corethron_pennatum NA NA 0.0263782 20 NA NA
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma Triparma_pacifica NA NA 0.0022029 4 NA NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Helicopedinella Helicopedinella_sp. NA NA 0.0073091 5 NA NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Mesopedinella Mesopedinella_arctica NA NA 0.0004326 3 NA NA
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Aureococcus Aureococcus_anophagefferens NA NA 0.4391393 28 NA NA
Rhodophyta Florideophyceae Ahnfeltiales Ahnfeltiaceae Ahnfeltia Ahnfeltia_plicata NA NA 0.0001100 1 NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Chondrus Chondrus_crispus NA NA 0.0011152 7 NA NA
long_species_comparison_upset <- long_species_comparison %>% select(species, contains("samples")) %>% rename_at(vars(contains("n_")), funs(str_replace(., 
    "n_samples_", "")))

fig_upset_list[["method species"]] <- plot_upset_long(long_species_comparison_upset, "../fig/upset_method_species.png")

Write to Excel file

openxlsx::write.xlsx(list(long_class_comparison, long_genus_comparison, long_species_comparison), file = "../dada2/method_comparison.xlsx", sheetName = c("Class", 
    "Genus", "Species"))

Comparison of species found in the different fractions for 18S filter and 18S sorted

  • Compute table of number of samples for each species (rows) vs the three fractions (columns)

  • Only keep

    • 2015 samples because it is the only dataset for which we have the three types of samples
    • Genera that do not contain _X
long_species_fraction <- list()
long_class_fraction <- list()

for (one_sample_type in sample_type[c(1, 3)]) {
    long_one <- long_species_sample[[one_sample_type]] %>% filter(date >= as.Date("2015-01-01")) %>% filter(!str_detect(species, "_X")) %>% group_by(fraction_name_original, 
        division, class, order, family, genus, species) %>% summarize(n_samples = n()) %>% pivot_wider(names_from = fraction_name_original, values_from = n_samples) %>% 
        ungroup()
    
    long_species_fraction[[one_sample_type]] <- long_one
    
    long_one <- long_class_sample[[one_sample_type]] %>% filter(date >= as.Date("2015-01-01")) %>% group_by(fraction_name_original, division, class) %>% 
        summarize(n_samples = n()) %>% pivot_wider(names_from = fraction_name_original, values_from = n_samples) %>% ungroup()
    
    long_class_fraction[[one_sample_type]] <- long_one
    
}

long_class_fraction_comparison <- long_class_fraction %>% purrr::reduce(full_join)
long_species_fraction_comparison <- long_species_fraction %>% purrr::reduce(full_join)

kable(long_class_fraction_comparison)
division class > 20 um 0.2-3 um 3-20 um nano pico
Chlorophyta Chlorophyceae 7 5 5 1 NA
Chlorophyta Mamiellophyceae 16 17 16 16 20
Chlorophyta Palmophyllophyceae 4 14 15 1 NA
Chlorophyta Pyramimonadophyceae 17 17 16 17 NA
Chlorophyta Trebouxiophyceae 4 NA 3 NA NA
Chlorophyta Ulvophyceae 13 10 12 NA 1
Cryptophyta Cryptophyceae 18 17 16 20 5
Haptophyta Prymnesiophyceae 18 17 16 20 20
Ochrophyta Bacillariophyta 18 17 16 20 20
Ochrophyta Bolidophyceae 18 17 16 19 18
Ochrophyta Chrysophyceae 12 16 16 1 NA
Ochrophyta Dictyochophyceae 10 17 16 13 NA
Ochrophyta MOCH-2 10 12 14 9 NA
Ochrophyta Pelagophyceae 18 17 16 20 20
Ochrophyta Phaeophyceae 18 11 16 9 NA
Rhodophyta Florideophyceae 17 12 15 NA NA
kable(long_species_fraction_comparison)
division class order family genus species > 20 um 0.2-3 um 3-20 um nano pico
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_kuwadae 5 3 3 NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_raudensis 1 NA 1 1 NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Pleurastrum Pleurastrum_sp. 1 1 2 NA NA
Chlorophyta Chlorophyceae Sphaeropleales Sphaeropleales_X Radiococcus Radiococcus_polycoccus 1 NA NA NA NA
Chlorophyta Mamiellophyceae Dolichomastigales Dolichomastigaceae Dolichomastigaceae-B Dolichomastigaceae-B_sp. 11 17 16 NA 2
Chlorophyta Mamiellophyceae Mamiellales Bathycoccaceae Bathycoccus Bathycoccus_prasinos 4 16 14 1 20
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Micromonas Micromonas_polaris 16 16 16 15 20
Chlorophyta Palmophyllophyceae Prasinococcales Prasinococcales-Clade-B Prasinoderma Prasinoderma_sp. 4 14 15 1 NA
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas Pyramimonas_australis 12 16 16 5 NA
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas Pyramimonas_gelidicola 17 17 16 17 NA
Chlorophyta Trebouxiophyceae Chlorellales Chlorellales_X Chlorella Chlorella_sorokiniana 1 NA NA NA NA
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Chlorothrix Chlorothrix_sp. 3 NA 2 NA NA
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Monostroma Monostroma_grevillei 9 8 9 NA NA
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Ulothrix Ulothrix_zonata 2 NA NA NA NA
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Acrochaete Acrochaete_leptochaete 2 3 6 NA 1
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Dilabifilum Dilabifilum_sp. 1 1 NA NA NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Geminigera Geminigera_cryophila 18 17 16 20 4
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Hemiselmis Hemiselmis_tepida 2 4 3 NA NA
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_antarctica 18 17 16 20 18
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_sp. 1 NA 1 9 NA
Haptophyta Prymnesiophyceae Prymnesiales Chrysochromulinaceae Chrysochromulina Chrysochromulina_sp. 3 9 9 20 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Asteroplanus Asteroplanus_karianus 18 17 16 18 1
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Grammonema Grammonema_striatula 1 NA 3 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Licmophora Licmophora_grandis 7 1 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Pteroncola Pteroncola_inane 7 1 3 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Synedra Synedra_hyperborea 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Synedropsis Synedropsis_recta 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Tabularia Tabularia_tabulata 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Thalassiothrix Thalassiothrix_longissima 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_debilis_2 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_neogracilis 18 17 16 13 17
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_peruvianus 1 2 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_rostratus 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_socialis 17 13 6 3 2
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Eucampia Eucampia_antarctica 2 2 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus Minidiscus_sp. 18 17 16 20 4
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Odontella Odontella_aurita 2 NA 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_glacialis 18 17 16 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_pseudodelicatula 3 1 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_pseudodenticulata 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Shionodiscus Shionodiscus_ritscheri 11 2 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_antarctica 1 NA 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_minima 18 17 16 19 7
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_oceanica 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_sp. 18 16 16 11 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_tumida 1 1 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Actinocyclus Actinocyclus_actinochilus 10 2 2 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Corethron Corethron_inerme 18 17 16 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Proboscia Proboscia_alata 6 5 7 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Proboscia Proboscia_inermis 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Rhizosolenia Rhizosolenia_imbricata_var_shrubsolei 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Stellarima Stellarima_microtrias 3 1 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Achnanthes Achnanthes_bongranii 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Amphora Amphora_proteus 12 2 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cocconeis Cocconeis_stauroneiformis 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella Cymbella_gastroides 6 3 9 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella Cymbella_laevis 2 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella Cymbella_salina 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Dickieia Dickieia_ulvacea 4 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Encyonema Encyonema_sp. 6 1 6 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis Fragilariopsis_cylindrus 18 17 16 20 16
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis Fragilariopsis_sublineata 10 4 16 5 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Gyrosigma Gyrosigma_limosum 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Haslea Haslea_spicula 3 2 2 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_phyllepta 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_sp. 4 2 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Naviculales Naviculales_sp. 4 7 11 3 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pinnularia Pinnularia_microstauron 1 NA NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pleurosigma Pleurosigma_intermedium 3 1 2 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia Pseudo-nitzschia_seriata 14 9 15 4 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudogomphonema Pseudogomphonema_sp. 10 5 6 NA NA
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3A Parmales_env_3A_sp. 2 9 NA NA NA
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3B Parmales_env_3B_sp. 16 17 16 19 11
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma Triparma_laevis_clade 18 17 16 8 14
Ochrophyta Dictyochophyceae Dictyochophyceae_X Dictyochales Dictyocha Dictyocha_speculum 1 NA NA NA NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Florenciella Florenciella_parvula 7 15 14 8 NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_farcimen 6 12 15 7 NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_sp. 1 1 5 2 NA
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonas Pelagomonas_calceolata 2 11 4 1 14
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia Desmarestia_menziesii 13 4 10 1 NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia Desmarestia_sp. 13 4 9 2 NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Ectocarpus Ectocarpus_siliculosus 4 NA 1 NA NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Phaeurus Phaeurus_antarcticus 15 8 14 6 NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Pylaiella Pylaiella_littoralis 1 NA 1 NA NA
Rhodophyta Florideophyceae Ceramiales Callithamniaceae Diapse Diapse_ptilota 1 NA NA NA NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Phycodrys Phycodrys_rubens 4 NA 1 NA NA
Rhodophyta Florideophyceae Colaconematales Colaconematales_X Palmaria Palmaria_palmata 1 2 3 NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Hapalidiaceae Hapalidiaceae_sp. 6 1 NA NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Mesophyllum Mesophyllum_sp. 16 10 13 NA NA
Rhodophyta Florideophyceae Corallinales Corallinales_X Synarthrophyton Synarthrophyton_patena 8 1 1 NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Chondrus Chondrus_nipponicus 17 7 15 NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Schottera Schottera_nicaeensis 1 NA NA NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Stenogramme Stenogramme_interrupta 3 NA 2 NA NA
Rhodophyta Florideophyceae Gracilariales Gracilariales_X Curdiea Curdiea_codiodes 7 1 3 NA NA
Rhodophyta Florideophyceae Plocamiales Plocamiales_X Trematocarpus Trematocarpus_fragilis 7 1 1 NA NA
Chlorophyta Chlorophyceae Chaetopeltidales Chaetopeltidaceae Planophila Planophila_sp. NA 1 NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_acidophila NA 1 NA NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_hedleyi NA 1 1 NA NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Haematococcus Haematococcus_zimbabwiensis NA 1 NA NA NA
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Mantoniella Mantoniella_squamata NA 1 NA 1 NA
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Micromonas Micromonas_clade_B3 NA 7 NA NA 18
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Teleaulax Teleaulax_sp. NA 1 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Thalassionema Thalassionema_frauenfeldii NA 1 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus Minidiscus_trioculatus NA 2 4 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Rhizosolenia Rhizosolenia_fallax NA 1 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Nitzschia Nitzschia_dissipata NA 1 NA NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pauliella Pauliella_toeniata NA 1 NA NA NA
Ochrophyta Chrysophyceae Chrysophyceae_X Chrysophyceae_Clade-C Spumella Spumella_elongata NA 5 NA NA NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Pseudopedinella Pseudopedinella_sp. NA 1 NA NA NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Hemineura Hemineura_frondosa NA 1 NA NA NA
Rhodophyta Florideophyceae Halymeniales Halymeniales_X Pachymenia Pachymenia_orbicularis NA 1 NA NA NA
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Desmococcus Desmococcus_endolithicus NA NA 1 NA NA
Chlorophyta Trebouxiophyceae Watanabea-Clade Watanabea-Clade_X Chloroidium Chloroidium_ellipsoideum NA NA 1 NA NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Falcomonas Falcomonas_sp. NA NA 2 NA NA
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_rex NA NA 1 NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_oestrupii NA NA 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cylindrotheca Cylindrotheca_closterium NA NA 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_perminuta NA NA 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Nitzschia Nitzschia_sp. NA NA 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia Pseudo-nitzschia_turgidula NA NA 1 NA NA
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma Triparma_laevis_f._inornata NA NA 1 NA NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Saccharina Saccharina_japonica NA NA 1 NA NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Falcomonas Falcomonas_daucoides NA NA NA 2 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Hemiselmis Hemiselmis_sp. NA NA NA 1 NA
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_pouchetii NA NA NA 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Bacillaria Bacillaria_paxillifer NA NA NA 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Luka_AeN707 Luka_AeN707-96_sp. NA NA NA 2 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia Pseudo-nitzschia_sp. NA NA NA 2 1
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_verruculosa NA NA NA 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Skeletonema Skeletonema_sp. NA NA NA NA 1
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonadaceae_clade_A Pelagomonadaceae_clade_A_sp. NA NA NA NA 1
fig_upset_list[["filter_sort species"]] <- plot_upset_long(long_species_fraction_comparison, "../fig/upset_filter_sort.png")

Comparison of species found in the different fractions for 18S filter

  • Compute table of number of samples for each species (rows) vs the three fractions (columns)

  • Only keep

    • Genera that do not contain _X
  • We consider now ALL samples (will need to remove samples for which the > 20 um is missing)

long_species_fraction <- list()
long_genus_fraction <- list()
long_class_fraction <- list()

for (one_sample_type in sample_type[c(1)]) {
    long_one <- long_species_sample[[one_sample_type]] %>% filter(!str_detect(species, "_X")) %>% group_by(fraction_name_original, division, class, 
        order, family, genus, species) %>% summarize(n_samples = n()) %>% pivot_wider(names_from = fraction_name_original, values_from = n_samples) %>% 
        ungroup()
    
    long_species_fraction[[one_sample_type]] <- long_one
    
    long_one <- long_species_sample[[one_sample_type]] %>% filter(!str_detect(species, "_X")) %>% group_by(fraction_name_original, division, class, 
        order, family, genus) %>% summarize(n_samples = n()) %>% pivot_wider(names_from = fraction_name_original, values_from = n_samples) %>% ungroup()
    
    long_genus_fraction[[one_sample_type]] <- long_one
    
    
    long_one <- long_class_sample[[one_sample_type]] %>% group_by(fraction_name_original, division, class) %>% summarize(n_samples = n()) %>% pivot_wider(names_from = fraction_name_original, 
        values_from = n_samples) %>% ungroup()
    
    long_class_fraction[[one_sample_type]] <- long_one
    
}

long_class_fraction_comparison <- long_class_fraction[[one_sample_type]]

long_genus_fraction_comparison <- long_genus_fraction[[one_sample_type]]

long_species_fraction_comparison <- long_species_fraction[[one_sample_type]]

kable(long_class_fraction_comparison)
division class > 20 um 0.2-3 um 3-20 um
Chlorophyta Chlorophyceae 8 6 6
Chlorophyta Mamiellophyceae 30 42 43
Chlorophyta Palmophyllophyceae 5 25 24
Chlorophyta Pyramimonadophyceae 28 38 43
Chlorophyta Trebouxiophyceae 9 1 7
Chlorophyta Ulvophyceae 28 26 28
Cryptophyta Cryptophyceae 35 42 43
Haptophyta Prymnesiophyceae 32 42 42
Ochrophyta Bacillariophyta 35 42 43
Ochrophyta Bolidophyceae 34 42 43
Ochrophyta Chrysophyceae 25 40 40
Ochrophyta Dictyochophyceae 27 42 43
Ochrophyta MOCH-1 1 3 4
Ochrophyta MOCH-2 15 23 35
Ochrophyta Pelagophyceae 34 42 43
Ochrophyta Phaeophyceae 33 33 42
Ochrophyta Xanthophyceae 1 NA NA
Rhodophyta Bangiophyceae 2 1 NA
Rhodophyta Florideophyceae 34 36 42
kable(long_genus_fraction_comparison)
division class order family genus > 20 um 0.2-3 um 3-20 um
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas 7 5 6
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Pleurastrum 1 1 2
Chlorophyta Chlorophyceae Sphaeropleales Sphaeropleales_X Radiococcus 1 NA NA
Chlorophyta Mamiellophyceae Dolichomastigales Dolichomastigaceae Dolichomastigaceae-B 14 25 26
Chlorophyta Mamiellophyceae Mamiellales Bathycoccaceae Bathycoccus 13 40 40
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Micromonas 27 60 44
Chlorophyta Palmophyllophyceae Prasinococcales Prasinococcales-Clade-B Prasinoderma 5 25 24
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas 43 66 77
Chlorophyta Trebouxiophyceae Chlorellales Chlorellales_X Chlorella 1 NA NA
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Koliella 1 NA NA
Chlorophyta Trebouxiophyceae Watanabea-Clade Watanabea-Clade_X Chloroidium 2 1 2
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Chlorothrix 15 5 8
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Monostroma 11 10 13
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Ulothrix 2 2 1
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Acrochaete 5 8 13
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Dilabifilum 3 5 5
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Geminigera 35 42 43
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Hemiselmis 2 7 7
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis 33 42 44
Haptophyta Prymnesiophyceae Prymnesiales Chrysochromulinaceae Chrysochromulina 6 23 31
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Asteroplanus 34 38 42
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Grammonema 8 2 8
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Licmophora 17 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Pteroncola 8 1 4
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Synedra 2 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Synedropsis 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Tabularia 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Thalassionema 2 1 2
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Thalassiothrix 4 2 3
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros 87 80 78
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Ditylum 2 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Eucampia 14 14 11
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Hemiaulus 3 3 5
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus 36 43 54
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Odontella 5 NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira 40 44 43
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Shionodiscus 19 3 4
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira 81 78 85
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Actinocyclus 27 7 5
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Asteromphalus 2 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Corethron 35 41 42
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Coscinodiscus 2 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Guinardia 1 1 3
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Proboscia 19 12 22
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Rhizosolenia 2 1 2
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Stellarima 10 4 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Achnanthes 3 NA 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Amphora 18 3 3
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cocconeis 1 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella 13 7 21
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Dickieia 4 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Encyonema 12 4 8
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis 48 49 71
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Gyrosigma 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Haslea 11 12 14
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula 12 7 10
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Naviculales 4 10 15
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pinnularia 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pleurosigma 3 1 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia 29 21 32
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudogomphonema 12 6 7
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3A 5 27 12
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3B 28 41 41
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma 34 47 49
Ochrophyta Chrysophyceae Chrysophyceae_X Chrysophyceae_Clade-C Pedospumella 1 1 NA
Ochrophyta Chrysophyceae Chrysophyceae_X Chrysophyceae_Clade-C Spumella 2 13 7
Ochrophyta Dictyochophyceae Dictyochophyceae_X Dictyochales Dictyocha 2 5 4
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Florenciella 13 38 40
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella 13 41 55
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonas 5 28 16
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia 42 26 39
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Ectocarpus 8 2 3
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Phaeurus 27 9 20
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Pylaiella 4 NA 2
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Saccharina 1 2 6
Ochrophyta Xanthophyceae Xanthophyceae_X Xanthophyceae_XX Botrydiopsis 1 NA NA
Rhodophyta Bangiophyceae Bangiales Bangiaceae Porphyra 1 NA NA
Rhodophyta Bangiophyceae Bangiales Bangiaceae Pyropia 1 1 NA
Rhodophyta Florideophyceae Ceramiales Callithamniaceae Diapse 2 1 NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Phycodrys 7 2 7
Rhodophyta Florideophyceae Colaconematales Colaconematales_X Palmaria 14 17 18
Rhodophyta Florideophyceae Corallinales Corallinales_X Hapalidiaceae 7 2 1
Rhodophyta Florideophyceae Corallinales Corallinales_X Mesophyllum 31 22 35
Rhodophyta Florideophyceae Corallinales Corallinales_X Synarthrophyton 11 2 1
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Chondrus 33 22 40
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Schottera 1 NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Stenogramme 4 NA 2
Rhodophyta Florideophyceae Gracilariales Gracilariales_X Curdiea 14 4 9
Rhodophyta Florideophyceae Plocamiales Plocamiales_X Trematocarpus 10 1 1
Chlorophyta Chlorophyceae Chaetopeltidales Chaetopeltidaceae Planophila NA 1 NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Haematococcus NA 1 NA
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Mantoniella NA 4 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Plagioselmis NA 1 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Teleaulax NA 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Nitzschia NA 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pauliella NA 1 1
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Pseudopedinella NA 1 2
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Pteridomonas NA 1 NA
Rhodophyta Florideophyceae Ceramiales Dasyaceae Dasya NA 1 NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Hemineura NA 1 NA
Rhodophyta Florideophyceae Ceramiales Rhodomelaceae Rhodomela NA 1 1
Rhodophyta Florideophyceae Ceramiales Sarcomeniaceae Platysiphonia NA 1 NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Kallymenia NA 1 2
Rhodophyta Florideophyceae Halymeniales Halymeniales_X Pachymenia NA 1 NA
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Desmococcus NA NA 1
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Prasiola NA NA 3
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Falcomonas NA NA 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cylindrotheca NA NA 1
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Delisea NA NA 1
kable(long_species_fraction_comparison)
division class order family genus species > 20 um 0.2-3 um 3-20 um
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_hedleyi 1 1 1
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_kuwadae 5 3 4
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_raudensis 1 NA 1
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Pleurastrum Pleurastrum_sp. 1 1 2
Chlorophyta Chlorophyceae Sphaeropleales Sphaeropleales_X Radiococcus Radiococcus_polycoccus 1 NA NA
Chlorophyta Mamiellophyceae Dolichomastigales Dolichomastigaceae Dolichomastigaceae-B Dolichomastigaceae-B_sp. 14 25 26
Chlorophyta Mamiellophyceae Mamiellales Bathycoccaceae Bathycoccus Bathycoccus_prasinos 13 40 40
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Micromonas Micromonas_clade_B3 2 19 4
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Micromonas Micromonas_polaris 25 41 40
Chlorophyta Palmophyllophyceae Prasinococcales Prasinococcales-Clade-B Prasinoderma Prasinoderma_sp. 5 25 24
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas Pyramimonas_australis 16 28 34
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas Pyramimonas_gelidicola 27 38 43
Chlorophyta Trebouxiophyceae Chlorellales Chlorellales_X Chlorella Chlorella_sorokiniana 1 NA NA
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Koliella Koliella_sempervirens 1 NA NA
Chlorophyta Trebouxiophyceae Watanabea-Clade Watanabea-Clade_X Chloroidium Chloroidium_saccharophila 2 1 1
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Chlorothrix Chlorothrix_sp. 15 5 8
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Monostroma Monostroma_grevillei 11 10 13
Chlorophyta Ulvophyceae Ulotrichales Ulotrichales_X Ulothrix Ulothrix_zonata 2 2 1
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Acrochaete Acrochaete_leptochaete 5 8 13
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Dilabifilum Dilabifilum_sp. 3 5 5
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Geminigera Geminigera_cryophila 35 42 43
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Hemiselmis Hemiselmis_tepida 2 7 7
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_antarctica 32 42 42
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_sp. 1 NA 1
Haptophyta Prymnesiophyceae Prymnesiales Chrysochromulinaceae Chrysochromulina Chrysochromulina_sp. 6 23 31
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Asteroplanus Asteroplanus_karianus 34 38 42
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Grammonema Grammonema_striatula 8 2 8
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Licmophora Licmophora_grandis 17 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Pteroncola Pteroncola_inane 8 1 4
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Synedra Synedra_hyperborea 2 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Synedropsis Synedropsis_recta 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Tabularia Tabularia_tabulata 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Thalassionema Thalassionema_frauenfeldii 2 1 2
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Thalassiothrix Thalassiothrix_longissima 4 2 3
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_danicus 4 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_debilis_2 12 9 9
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_dichaeta 3 3 2
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_neogracilis 32 37 42
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_peruvianus 2 3 3
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_rostratus 10 3 7
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_socialis 24 21 13
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Ditylum Ditylum_sol 2 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Eucampia Eucampia_antarctica 14 14 11
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Hemiaulus Hemiaulus_sinensis 3 3 5
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus Minidiscus_sp. 35 41 43
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus Minidiscus_trioculatus 1 2 11
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Odontella Odontella_aurita 2 NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Odontella Odontella_mobiliensis 3 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_glacialis 35 42 41
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_pseudodelicatula 3 2 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_pseudodenticulata 2 NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Shionodiscus Shionodiscus_ritscheri 19 3 4
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_antarctica 1 NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_minima 34 40 43
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_oceanica 1 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_rotula 1 NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_sp. 32 36 35
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_tumida 12 1 2
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Actinocyclus Actinocyclus_actinochilus 22 5 4
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Actinocyclus Actinocyclus_curvatulus 5 2 1
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Asteromphalus Asteromphalus_sp. 2 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Corethron Corethron_inerme 35 41 42
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Coscinodiscus Coscinodiscus_concinnus 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Coscinodiscus Coscinodiscus_jonesianus 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Guinardia Guinardia_solstherfothii 1 NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Proboscia Proboscia_alata 18 12 22
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Proboscia Proboscia_inermis 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Rhizosolenia Rhizosolenia_imbricata_var_shrubsolei 2 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Stellarima Stellarima_microtrias 10 4 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Achnanthes Achnanthes_bongranii 3 NA 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Amphora Amphora_proteus 18 3 3
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cocconeis Cocconeis_stauroneiformis 1 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella Cymbella_gastroides 9 7 21
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella Cymbella_laevis 3 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cymbella Cymbella_salina 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Dickieia Dickieia_ulvacea 4 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Encyonema Encyonema_sp. 12 4 8
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis Fragilariopsis_cylindrus 35 42 43
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis Fragilariopsis_sublineata 13 7 28
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Gyrosigma Gyrosigma_limosum 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Haslea Haslea_spicula 11 12 14
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_lanceolata 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_phyllepta 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_sp. 10 7 9
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Naviculales Naviculales_sp. 4 10 15
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pinnularia Pinnularia_microstauron 1 NA NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pleurosigma Pleurosigma_intermedium 3 1 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia Pseudo-nitzschia_seriata 29 21 31
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudogomphonema Pseudogomphonema_sp. 12 6 7
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3A Parmales_env_3A_sp. 5 27 12
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3B Parmales_env_3B_sp. 28 41 41
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma Triparma_laevis_clade 34 41 43
Ochrophyta Chrysophyceae Chrysophyceae_X Chrysophyceae_Clade-C Pedospumella Pedospumella_encystans 1 1 NA
Ochrophyta Chrysophyceae Chrysophyceae_X Chrysophyceae_Clade-C Spumella Spumella_elongata 2 13 7
Ochrophyta Dictyochophyceae Dictyochophyceae_X Dictyochales Dictyocha Dictyocha_speculum 2 5 4
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Florenciella Florenciella_parvula 13 38 40
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_farcimen 10 31 42
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_sp. 3 10 13
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonas Pelagomonas_calceolata 5 28 16
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia Desmarestia_menziesii 22 9 16
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia Desmarestia_sp. 20 16 23
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Ectocarpus Ectocarpus_siliculosus 8 2 3
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Phaeurus Phaeurus_antarcticus 27 9 20
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Pylaiella Pylaiella_littoralis 4 NA 2
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Saccharina Saccharina_japonica 1 2 6
Ochrophyta Xanthophyceae Xanthophyceae_X Xanthophyceae_XX Botrydiopsis Botrydiopsis_callosa 1 NA NA
Rhodophyta Bangiophyceae Bangiales Bangiaceae Porphyra Porphyra_plocamiestris 1 NA NA
Rhodophyta Bangiophyceae Bangiales Bangiaceae Pyropia Pyropia_sp. 1 NA NA
Rhodophyta Florideophyceae Ceramiales Callithamniaceae Diapse Diapse_ptilota 2 1 NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Phycodrys Phycodrys_rubens 7 2 7
Rhodophyta Florideophyceae Colaconematales Colaconematales_X Palmaria Palmaria_palmata 14 17 18
Rhodophyta Florideophyceae Corallinales Corallinales_X Hapalidiaceae Hapalidiaceae_sp. 7 2 1
Rhodophyta Florideophyceae Corallinales Corallinales_X Mesophyllum Mesophyllum_sp. 31 22 35
Rhodophyta Florideophyceae Corallinales Corallinales_X Synarthrophyton Synarthrophyton_patena 11 2 1
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Chondrus Chondrus_nipponicus 33 22 40
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Schottera Schottera_nicaeensis 1 NA NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Stenogramme Stenogramme_interrupta 4 NA 2
Rhodophyta Florideophyceae Gracilariales Gracilariales_X Curdiea Curdiea_codiodes 14 4 9
Rhodophyta Florideophyceae Plocamiales Plocamiales_X Trematocarpus Trematocarpus_fragilis 10 1 1
Chlorophyta Chlorophyceae Chaetopeltidales Chaetopeltidaceae Planophila Planophila_sp. NA 1 NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_acidophila NA 1 NA
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Haematococcus Haematococcus_zimbabwiensis NA 1 NA
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Mantoniella Mantoniella_squamata NA 4 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Plagioselmis Plagioselmis_nannoplanctica NA 1 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Teleaulax Teleaulax_sp. NA 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_gelidus NA 3 1
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Guinardia Guinardia_delicatula NA 1 2
Ochrophyta Bacillariophyta Bacillariophyta_X Radial-centric-basal-Coscinodiscophyceae Rhizosolenia Rhizosolenia_fallax NA 1 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Nitzschia Nitzschia_dissipata NA 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pauliella Pauliella_toeniata NA 1 1
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma Triparma_sp. NA 6 5
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Pseudopedinella Pseudopedinella_sp. NA 1 2
Ochrophyta Dictyochophyceae Dictyochophyceae_X Pedinellales Pteridomonas Pteridomonas_danica NA 1 NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia Desmarestia_anceps NA 1 NA
Rhodophyta Bangiophyceae Bangiales Bangiaceae Pyropia Pyropia_dentata NA 1 NA
Rhodophyta Florideophyceae Ceramiales Dasyaceae Dasya Dasya_collabens NA 1 NA
Rhodophyta Florideophyceae Ceramiales Delesseriaceae Hemineura Hemineura_frondosa NA 1 NA
Rhodophyta Florideophyceae Ceramiales Rhodomelaceae Rhodomela Rhodomela_confervoides NA 1 1
Rhodophyta Florideophyceae Ceramiales Sarcomeniaceae Platysiphonia Platysiphonia_victoriae NA 1 NA
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Kallymenia Kallymenia_tasmanica NA 1 2
Rhodophyta Florideophyceae Halymeniales Halymeniales_X Pachymenia Pachymenia_orbicularis NA 1 NA
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Desmococcus Desmococcus_endolithicus NA NA 1
Chlorophyta Trebouxiophyceae Prasiolales Prasiolales_X Prasiola Prasiola_crispa NA NA 3
Chlorophyta Trebouxiophyceae Watanabea-Clade Watanabea-Clade_X Chloroidium Chloroidium_ellipsoideum NA NA 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Falcomonas Falcomonas_sp. NA NA 2
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_rex NA NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_sp. NA NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_oestrupii NA NA 2
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Cylindrotheca Cylindrotheca_closterium NA NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Navicula Navicula_perminuta NA NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Nitzschia Nitzschia_sp. NA NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia Pseudo-nitzschia_turgidula NA NA 1
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma Triparma_laevis_f._inornata NA NA 1
Rhodophyta Florideophyceae Gigartinales Gigartinales_X Delisea Delisea_pulchra NA NA 1
fig_upset_list[["filter genus"]] <- plot_upset_long(long_genus_fraction_comparison, "../fig/upset_filter_genus.png")

fig_upset_list[["filter species"]] <- plot_upset_long(long_species_fraction_comparison, "../fig/upset_filter_species.png")

Comparison of species found in the different fractions for 18S sort

  • Compute table of number of samples for each species (rows) vs the three fractions (columns)

  • Only keep

    • Genera that do not contain _X
  • We consider now ALL samples (will need to remove samples for which the > 20 um is missing)

long_species_fraction <- list()
long_class_fraction <- list()

for (one_sample_type in sample_type[c(3)]) {
    long_one <- long_species_sample[[one_sample_type]] %>% filter(!str_detect(species, "_X")) %>% group_by(fraction_name_original, division, class, 
        order, family, genus, species) %>% summarize(n_samples = n()) %>% pivot_wider(names_from = fraction_name_original, values_from = n_samples) %>% 
        ungroup()
    
    long_species_fraction[[one_sample_type]] <- long_one
    
    long_one <- long_species_sample[[one_sample_type]] %>% filter(!str_detect(species, "_X")) %>% group_by(fraction_name_original, division, class, 
        order, family, genus) %>% summarize(n_samples = n()) %>% pivot_wider(names_from = fraction_name_original, values_from = n_samples) %>% ungroup()
    
    long_genus_fraction[[one_sample_type]] <- long_one
    
    long_one <- long_class_sample[[one_sample_type]] %>% group_by(fraction_name_original, division, class) %>% summarize(n_samples = n()) %>% pivot_wider(names_from = fraction_name_original, 
        values_from = n_samples) %>% ungroup()
    
    long_class_fraction[[one_sample_type]] <- long_one
    
}

long_class_fraction_comparison <- long_class_fraction[[one_sample_type]]

long_genus_fraction_comparison <- long_genus_fraction[[one_sample_type]]

long_species_fraction_comparison <- long_species_fraction[[one_sample_type]]

kable(long_class_fraction_comparison)
division class nano pico
Chlorophyta Chlorophyceae 1 NA
Chlorophyta Mamiellophyceae 16 20
Chlorophyta Palmophyllophyceae 1 NA
Chlorophyta Pyramimonadophyceae 17 NA
Cryptophyta Cryptophyceae 20 5
Haptophyta Prymnesiophyceae 20 20
Ochrophyta Bacillariophyta 20 20
Ochrophyta Bolidophyceae 19 18
Ochrophyta Chrysophyceae 1 NA
Ochrophyta Dictyochophyceae 13 NA
Ochrophyta MOCH-2 9 NA
Ochrophyta Pelagophyceae 20 20
Ochrophyta Phaeophyceae 9 NA
Chlorophyta Ulvophyceae NA 1
kable(long_genus_fraction_comparison)
division class order family genus nano pico
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas 1 NA
Chlorophyta Mamiellophyceae Mamiellales Bathycoccaceae Bathycoccus 1 20
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Mantoniella 1 NA
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Micromonas 15 38
Chlorophyta Palmophyllophyceae Prasinococcales Prasinococcales-Clade-B Prasinoderma 1 NA
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas 22 NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Falcomonas 2 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Geminigera 20 4
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Hemiselmis 1 NA
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis 30 20
Haptophyta Prymnesiophyceae Prymnesiales Chrysochromulinaceae Chrysochromulina 20 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Asteroplanus 18 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros 16 19
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus 20 4
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira 30 8
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Bacillaria 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis 25 16
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Luka_AeN707 2 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Naviculales 3 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia 6 1
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3B 19 11
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma 8 14
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Florenciella 8 NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella 10 NA
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonas 1 14
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia 3 NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Phaeurus 6 NA
Chlorophyta Mamiellophyceae Dolichomastigales Dolichomastigaceae Dolichomastigaceae-B NA 2
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Acrochaete NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Skeletonema NA 1
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonadaceae_clade_A NA 1
kable(long_species_fraction_comparison)
division class order family genus species nano pico
Chlorophyta Chlorophyceae Chlamydomonadales Chlamydomonadales_X Chlamydomonas Chlamydomonas_raudensis 1 NA
Chlorophyta Mamiellophyceae Mamiellales Bathycoccaceae Bathycoccus Bathycoccus_prasinos 1 20
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Mantoniella Mantoniella_squamata 1 NA
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Micromonas Micromonas_polaris 15 20
Chlorophyta Palmophyllophyceae Prasinococcales Prasinococcales-Clade-B Prasinoderma Prasinoderma_sp. 1 NA
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas Pyramimonas_australis 5 NA
Chlorophyta Pyramimonadophyceae Pyramimonadales Pyramimonadaceae Pyramimonas Pyramimonas_gelidicola 17 NA
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Falcomonas Falcomonas_daucoides 2 1
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Geminigera Geminigera_cryophila 20 4
Cryptophyta Cryptophyceae Cryptomonadales Cryptomonadales_X Hemiselmis Hemiselmis_sp. 1 NA
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_antarctica 20 18
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_pouchetii 1 1
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_sp. 9 NA
Haptophyta Prymnesiophyceae Prymnesiales Chrysochromulinaceae Chrysochromulina Chrysochromulina_sp. 20 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Araphid-pennate Asteroplanus Asteroplanus_karianus 18 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_neogracilis 13 17
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Chaetoceros Chaetoceros_socialis 3 2
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Minidiscus Minidiscus_sp. 20 4
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Porosira Porosira_glacialis 1 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_minima 19 7
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Thalassiosira Thalassiosira_sp. 11 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Bacillaria Bacillaria_paxillifer 1 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis Fragilariopsis_cylindrus 20 16
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Fragilariopsis Fragilariopsis_sublineata 5 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Luka_AeN707 Luka_AeN707-96_sp. 2 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Naviculales Naviculales_sp. 3 1
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia Pseudo-nitzschia_seriata 4 NA
Ochrophyta Bacillariophyta Bacillariophyta_X Raphid-pennate Pseudo-nitzschia Pseudo-nitzschia_sp. 2 1
Ochrophyta Bolidophyceae Parmales Parmales_env_3 Parmales_env_3B Parmales_env_3B_sp. 19 11
Ochrophyta Bolidophyceae Parmales Triparmaceae Triparma Triparma_laevis_clade 8 14
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Florenciella Florenciella_parvula 8 NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_farcimen 7 NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_sp. 2 NA
Ochrophyta Dictyochophyceae Dictyochophyceae_X Florenciellales Pseudochattonella Pseudochattonella_verruculosa 1 NA
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonas Pelagomonas_calceolata 1 14
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia Desmarestia_menziesii 1 NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Desmarestia Desmarestia_sp. 2 NA
Ochrophyta Phaeophyceae Phaeophyceae_X Phaeophyceae_XX Phaeurus Phaeurus_antarcticus 6 NA
Chlorophyta Mamiellophyceae Dolichomastigales Dolichomastigaceae Dolichomastigaceae-B Dolichomastigaceae-B_sp. NA 2
Chlorophyta Mamiellophyceae Mamiellales Mamiellaceae Micromonas Micromonas_clade_B3 NA 18
Chlorophyta Ulvophyceae Ulvales-relatives Ulvales-relatives_X Acrochaete Acrochaete_leptochaete NA 1
Haptophyta Prymnesiophyceae Phaeocystales Phaeocystaceae Phaeocystis Phaeocystis_rex NA 1
Ochrophyta Bacillariophyta Bacillariophyta_X Polar-centric-Mediophyceae Skeletonema Skeletonema_sp. NA 1
Ochrophyta Pelagophyceae Pelagomonadales Pelagomonadaceae Pelagomonadaceae_clade_A Pelagomonadaceae_clade_A_sp. NA 1
fig_upset_list[["sort genus"]] <- plot_upset_long(long_genus_fraction_comparison, "../fig/upset_sort_genus.png")

fig_upset_list[["sort species"]] <- plot_upset_long(long_species_fraction_comparison, "../fig/upset_sort_species.png")

Figures

Class legend

  dummy <- long[["18S filter surface"]] %>% 
   count(class, wt= n_reads)

  legend_class <- ggplot(dummy, aes (x = class, y = n, fill = class)) +  
    geom_col() +
    scale_fill_manual(values = class_colors, drop = FALSE) +
    guides(fill = guide_legend(title.position="top",
                               ncol = 6, byrow = TRUE))
  
  legend_class

  legend_class <- ggpubr::get_legend(legend_class  + 
                      # create some space to the left of the legend    
                      theme(legend.box.margin = margin(t = 0, r = 0, b = 0, l = 0))
                    )
  
  ggpubr::as_ggplot(legend_class)

List of genera

dummy <- long[["18S filter surface"]] %>% bind_rows(long[["18S sort surface"]]) %>% bind_rows(long[["16S plastid surface"]]) %>% count(class, genus, 
    wt = n_reads) %>% select(-n)

openxlsx::write.xlsx(dummy, "genus_colors.xlsx")

Figure 2 - Treemap

Cowplot - DO NOT USE

treemap_18S_filt <- cowplot::plot_grid(treemap_class[["18S filter 0.2 um surface"]]$gg + ggtitle("0.2 µm"), treemap_class[["18S filter 3 um surface"]]$gg + 
    ggtitle("3 µm"), treemap_class[["18S filter 20 um surface"]]$gg + ggtitle("20 µm"), ncol = 1)

treemap_18S_sort <- cowplot::plot_grid(treemap_class[["18S sort pico surface"]]$gg, treemap_class[["18S sort nano surface"]]$gg, treemap_class[["fill in"]]$gg, 
    ncol = 1)

treemap_16S_filt <- cowplot::plot_grid(treemap_class[["16S plastid 0.2 um surface"]]$gg, treemap_class[["16S plastid 3 um surface"]]$gg, treemap_class[["16S plastid 20 um surface"]]$gg, 
    ncol = 1)

fig_2 <- cowplot::plot_grid(legend_class, NULL, bargraph_species[["18S filter surface"]]$gg + theme(legend.position = "none"), treemap_18S_filt, 
    bargraph_species[["18S sort surface"]]$gg + theme(legend.position = "none"), treemap_18S_sort, bargraph_species[["16S plastid surface"]]$gg + 
        theme(legend.position = "none"), treemap_16S_filt, ncol = 2, rel_widths = c(3, 1), rel_heights = c(1, 3, 3, 3), align = "v")

fig_2

Patchwork

treemap_18S_filt <- (treemap_class[["18S filter 0.2 um surface"]]$gg + ggtitle("0.2 µm"))/(treemap_class[["18S filter 3 um surface"]]$gg + ggtitle("3 µm"))/(treemap_class[["18S filter 20 um surface"]]$gg + 
    ggtitle("20 µm"))

treemap_18S_sort <- (treemap_class[["18S sort pico surface"]]$gg + ggtitle("0.2 µm"))/(treemap_class[["18S sort nano surface"]]$gg + ggtitle("3 µm"))/plot_spacer()

treemap_16S_filt <- (treemap_class[["16S plastid 0.2 um surface"]]$gg + ggtitle("0.2 µm"))/(treemap_class[["16S plastid 3 um surface"]]$gg + ggtitle("3 µm"))/(treemap_class[["16S plastid 20 um surface"]]$gg + 
    ggtitle("20 µm"))

fig_2 <- ggpubr::as_ggplot(legend_class)/
(bargraph_species[["18S filter surface"]]$gg + theme(legend.position = "none") + treemap_18S_filt + plot_layout(widths = c(3, 1)))/(bargraph_species[["18S sort surface"]]$gg + 
    theme(legend.position = "none") + treemap_18S_sort + plot_layout(widths = c(3, 1)))/(bargraph_species[["16S plastid surface"]]$gg + theme(legend.position = "none") + 
    ggtitle("16S filter surface") + treemap_16S_filt + plot_layout(widths = c(3, 1))) + plot_layout(heights = c(1, 3, 3, 3))

fig_2

Figure Supp - Treemap at genus level

treemap_18S_filt <- cowplot::plot_grid(treemap_genus[["18S filter 0.2 um surface"]]$gg + labs(title = "18S filter", subtitle =  "0.2 µm"),
                                       treemap_genus[["18S filter 3 um surface"]]$gg + labs(title = "", subtitle =  "3 µm") +
                                         theme(plot.title=element_blank()),
                                       treemap_genus[["18S filter 20 um surface"]]$gg + labs(title = "", subtitle =  "20 µm")+
                                         theme(plot.title=element_blank()), 
                                       ncol=1)

treemap_18S_sort <- cowplot::plot_grid(treemap_genus[["18S sort pico surface"]]$gg + labs(title = "18S sort", subtitle =  "pico"),
                                       treemap_genus[["18S sort nano surface"]]$gg + labs(title = "", subtitle =  "nano")+
                                         theme(plot.title=element_blank()),
                                       treemap_genus[["fill in"]]$gg,
                                       ncol=1)

treemap_16S_filt <- cowplot::plot_grid(treemap_genus[["16S plastid 0.2 um surface"]]$gg + labs(title = "16S filter", subtitle =  "0.2 µm"),
                                       treemap_genus[["16S plastid 3 um surface"]]$gg + labs(title = "", subtitle =  "3 µm")+
                                         theme(plot.title=element_blank()),
                                       treemap_genus[["16S plastid 20 um surface"]]$gg + labs(title = "", subtitle =  "20 µm")+
                                         theme(plot.title=element_blank()), 
                                       ncol=1)

fig_supp_treemap <- cowplot::plot_grid(treemap_18S_filt,
                            treemap_18S_sort,
                            treemap_16S_filt,
                           # labels = c("A" ,"B", "C"), label_x = 0.9,
                            ncol=3)

fig_supp_treemap

Figure 3 - NMDS 18S filter

Cowplot - DO NOT USE

fig_3 <- cowplot::plot_grid(nmds_sample[["18S filter surface"]]$gg_samples, nmds_sample[["18S filter surface"]]$gg_taxa, labels = c("A", "B"), label_x = 0.9, 
    nrow = 2, rel_widths = c(1, 1))

fig_3

Patchwork

fig_3 <- (nmds_sample[["18S filter surface"]]$gg_samples + labs(title = "18S filter", shape = "fraction"))/nmds_sample[["18S filter surface"]]$gg_taxa + 
    ggtitle("")

fig_3

Figure sup - NMDS 16S plastid

Cowplot - DO NOT USE

fig_NMDS_plastid <- cowplot::plot_grid(nmds_sample[["16S plastid surface"]]$gg_samples + ggtitle("16S filter"), nmds_sample[["16S plastid surface"]]$gg_taxa + 
    ggtitle(""), labels = c("A", "B"), label_x = 0.9, nrow = 2, rel_widths = c(1, 1))

fig_NMDS_plastid

Patchwork

fig_NMDS_plastid <- (nmds_sample[["16S plastid surface"]]$gg_samples + labs(title = "16S filter", shape = "fraction"))/nmds_sample[["16S plastid surface"]]$gg_taxa + 
    ggtitle("")

fig_NMDS_plastid

Figure 4 - Heatmap 18S filter

Cowplot

fig_4 <- cowplot::plot_grid(heatmap_class_selected[["18S filter 0.2 um surface"]], heatmap_class_selected[["18S filter 3 um surface"]], heatmap_class_selected[["18S filter 20 um surface"]], 
    heatmap_species_selected[["18S filter 0.2 um surface"]], heatmap_species_selected[["18S filter 3 um surface"]], heatmap_species_selected[["18S filter 20 um surface"]], 
    labels = c("A", "B", "C", "D", "E", "F"), label_x = 0.9, nrow = 2, ncol = 3)
fig_4

Patchwork

fig_4 <- heatmap_class_selected[["18S filter 0.2 um surface"]] + labs(title = "0.2 µm") + theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + 
    
heatmap_class_selected[["18S filter 3 um surface"]] + labs(title = "3 µm") + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), 
    axis.text.y = element_blank()) + 
heatmap_class_selected[["18S filter 20 um surface"]] + labs(title = "20 µm") + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), 
    axis.text.y = element_blank()) + 
heatmap_species_selected[["18S filter 0.2 um surface"]] + labs(title = "") + theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + 
    
heatmap_species_selected[["18S filter 3 um surface"]] + labs(title = "") + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), 
    axis.text.y = element_blank()) + 
heatmap_species_selected[["18S filter 20 um surface"]] + labs(title = "") + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), 
    axis.text.y = element_blank()) + 
plot_layout(nrow = 2, byrow = TRUE, guides = "collect")

fig_4

Figure sup - Heatmap 18S sort

Cowplot - DO NOT USE

fig_heatmap_sort <- cowplot::plot_grid(heatmap_class_selected[["18S sort pico surface"]], heatmap_class_selected[["18S sort nano surface"]], heatmap_species_selected[["18S sort pico surface"]], 
    heatmap_species_selected[["18S sort nano surface"]], labels = c("A", "B", "C", "D"), label_x = 0.9, nrow = 2, ncol = 2)
fig_heatmap_sort

Patchwork

fig_heatmap_sort <- heatmap_class_selected[["18S sort pico surface"]] + labs(title = "pico") + theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + 
    
heatmap_class_selected[["18S sort nano surface"]] + labs(title = "nano") + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), 
    axis.text.y = element_blank()) + 
heatmap_species_selected[["18S sort pico surface"]] + labs(title = "") + theme(axis.title.x = element_blank(), axis.title.y = element_blank()) + 
    
heatmap_species_selected[["18S sort nano surface"]] + labs(title = "") + theme(axis.title.x = element_blank(), axis.title.y = element_blank(), axis.text.y = element_blank()) + 
    
plot_layout(nrow = 2, byrow = TRUE, guides = "collect")

fig_heatmap_sort

Figure 6 - Vertical Profile

Cowplot - DO NOT USE

legend <- cowplot::get_legend( bargraph_sample[["18S filter 0.2 um profile"]] + 
                      # create some space to the left of the legend    
                      theme(legend.box.margin = margin(0, 0, 0, 20))
                    )
fig_6 <- cowplot::plot_grid(bargraph_sample[["18S filter 0.2 um profile"]]+ theme(legend.position="none"),legend,
                            bargraph_sample[["18S filter 3 um profile"]] + theme(legend.position="none"),NULL,
                            bargraph_sample[["18S filter 20 um profile"]]+ theme(legend.position="none"),NULL,
                            labels = c("" ,"A","", "B","", "C"), label_x = 0.9,
                            nrow=3, ncol=2, rel_widths = c(3, 1.7))
fig_6

Patchwork

fig_6 <- ggpubr::as_ggplot(legend_class)/(bargraph_sample[["18S filter 0.2 um profile"]] + theme(legend.position = "none") + labs(title = "0.2 µm") + 
    bargraph_sample[["18S filter 3 um profile"]] + theme(legend.position = "none", axis.title.y = element_blank()) + labs(title = "3 µm") + bargraph_sample[["18S filter 20 um profile"]] + 
    theme(legend.position = "none", axis.title.y = element_blank()) + labs(title = "20 µm")) + plot_layout(heights = c(0.3, 1))
fig_6

Figure X - Upset R

p1 <- cowplot::ggdraw() + cowplot::draw_image("../fig/upset_method_genus.png")
p2 <- cowplot::ggdraw() + cowplot::draw_image("../fig/upset_filter_genus.png")
p3 <- cowplot::ggdraw() + cowplot::draw_image("../fig/upset_sort_genus.png")

fig_X_upset <- cowplot::plot_grid(p1, p2, p3, labels = c("A", "B", "C"), label_x = 0.9, nrow = 3, ncol = 1)
fig_X_upset

Patchword - DO NOT USE

ggplotify::as.ggplot(fig_upset_list[["method"]])/ggplotify::as.ggplot(fig_upset_list[["filter"]])/ggplotify::as.ggplot(fig_upset_list[["sort"]])

Save figures

fig_path <- function(file) str_c("C:/daniel.vaulot@gmail.com/Papers/2020 Trefault Antarctic/Antarctic_overleaf_version_3.0/fig/", file)


ggsave(plot = fig_2, filename = fig_path("Figure_treeplot.pdf"), width = 12, height = 25, scale = 2.5, units = "cm", useDingbats = FALSE)
ggsave(plot = fig_3, filename = fig_path("Figure_NMDS.pdf"), width = 12, height = 18, scale = 1.75, units = "cm", useDingbats = FALSE)
ggsave(plot = fig_4, filename = fig_path("Figure_heatmap.pdf"), width = 20, height = 10, scale = 2.2, units = "cm", useDingbats = FALSE)
ggsave(plot = fig_6, filename = fig_path("Figure_vertical_profile.pdf"), width = 13, height = 8, scale = 2.2, units = "cm", useDingbats = FALSE)
ggsave(plot = fig_X_upset, filename = fig_path("Figure_upset.pdf"), width = 8, height = 17, scale = 2.2, units = "cm", useDingbats = FALSE)

ggsave(plot = fig_NMDS_plastid, filename = fig_path("Figure-sup_NMDS_16S_plastid.pdf"), width = 12, height = 18, scale = 1.75, units = "cm", useDingbats = FALSE)
ggsave(plot = fig_heatmap_sort, filename = fig_path("Figure-sup_heatmap_18S_sort.pdf"), width = 12, height = 10, scale = 2, units = "cm", useDingbats = FALSE)
ggsave(plot = fig_supp_treemap, filename = fig_path("Figure-sup_treemap_genus.pdf"), width = 12, height = 12, scale = 2, units = "cm", useDingbats = FALSE)


Figure - sup_NMDS_16S_plastid.pdf
Figure - sup_treemap_genus.pdf

Figure_upset.pdf
Figure_vertical_profile.pdf
Figure_vertical_profile_side.pdf
Figure - sup_heatmap_18S_sort.pdf

Saving Tables to Latex

library(xtable)

Define function to format the tables

  • Not used
    • “X” = “\\cellcolor{gray}”
sanitize.italics <- function(str) {
  str_replace_all(str, c(#"_" = "\\\\_", 
                         # "ital\\{" = "\\\\textit{", 
                         "°" = "\\\\degree",
                         "±"="$\\pm$"))
}

File path

path_table <- function(file_table) {
    str_c("C:/daniel.vaulot@gmail.com/Papers/2020 Trefault Antarctic/Antarctic_overleaf_version_3.0/tables/", file_table)
}

file_main <- path_table("Tables.xlsx")

Read legends

legends <- readxl::read_excel(path = file_main, sheet = "Table legends")

Table - Data sets

one_sheet <- "Table data sets"
one_legend <- filter(legends, table == one_sheet)
one_caption <- one_legend$legend[1]
one_label <- one_legend$label[1]
one_file <- one_legend$file_name[1]

table <- readxl::read_excel(path = file_main, sheet = one_sheet, range = "A1:G4")
table <- xtable::xtable(table, label = one_label, caption = one_caption, align = c("l", "c", "c", "c", "c", "c", "c", "c"), digits = 0)
print(table, scalebox = 0.85, caption.placement = "top", include.rownames = FALSE, file = path_table(one_file), sanitize.text.function = sanitize.italics)

Table - Samples

one_sheet <- "Table samples"
one_legend <- filter(legends, table == one_sheet)
one_caption <- one_legend$legend[1]
one_label <- one_legend$label[1]
one_file <- one_legend$file_name[1]

addtorow <- list()
addtorow$pos <- list(0, 0)
addtorow$command <- c("Date & Season & CTD & Chl & FCM & Nutrients & Profile & \\multicolumn{3}{c}{18S rRNA filter} & \\multicolumn{3}{c}{16S rRNA plastid filter}  & \\multicolumn{2}{c}{18S rRNA sort} \\\\\n", 
    "& & & & & & & 0.2 $\\mu$m  & 3 $\\mu$m  & 20 $\\mu$m  & 0.2 $\\mu$m  & 3 $\\mu$m  & 20 $\\mu$m  & Pico  & Nano \\\\\n")


table <- readxl::read_excel(path = file_main, sheet = one_sheet, range = "A3:O22", col_names = FALSE)
table <- xtable::xtable(table, label = one_label, caption = one_caption, align = c("l", "l", "c", "c", "c", "c", "c", "c", "c", "c", "c", "c", "c", 
    "c", "c", "c"), digits = 0)
print(table, scalebox = 0.75, caption.placement = "top", add.to.row = addtorow, include.colnames = FALSE, include.rownames = FALSE, file = path_table(one_file), 
    sanitize.text.function = sanitize.italics)

Table - Vertical Profile

one_sheet <- "Table vertical profile"
one_legend <- filter(legends, table == one_sheet)
one_caption <- one_legend$legend[1]
one_label <- one_legend$label[1]
one_file <- one_legend$file_name[1]

table <- readxl::read_excel(path = file_main, sheet = one_sheet, range = "A1:K6")
table <- xtable::xtable(table, label = one_label, caption = one_caption, align = c("l", "c", "c", "c", "c", "c", "c", "c", "c", "c", "c", "c"), 
    digits = c(0, 0, 2, 1, 2, 1, 2, 2, 1, 0, 0, 0))
print(table, scalebox = 1, caption.placement = "top", include.rownames = FALSE, file = path_table(one_file), sanitize.text.function = sanitize.italics)

2020-07-16